GlisWeb framework
mem1.php
Vai alla documentazione di questo file.
1 <?php
2 
4 {
5  $status = file_get_contents('/proc/' . getmypid() . '/status');
6 
7  $matchArr = array();
8  preg_match_all('~^(VmRSS|VmSwap):\s*([0-9]+).*$~im', $status, $matchArr);
9 
10  if(!isset($matchArr[2][0]) || !isset($matchArr[2][1]))
11  {
12  return false;
13  }
14 
15  return intval($matchArr[2][0]) + intval($matchArr[2][1]);
16 }
17 
19 
20 ?>
memory_get_process_usage()
Definition: mem1.php:3