Forum Moderators: phranque
This test should have allocated 450-500 megs in total, but for some reason, I can only see about 100 megs when I use free. And, top shows about 110 megs...
Am I doing something wrong here? Why can't I see this 500 megs and/or how can I see it?
Thanks.
free RESULTStotal used free shared buffers cached
BEFORE RUNNING THE TESTS:
Mem: 1035436 989896 45540 0 89892 780480
Swap: 2056300 295640 1760660DURING THE TESTS (AFTER MEMORY ALLOCATION, PHP STILL IS IN SLEEP):
Mem: 1035436 1021228 14208 0 90692 721304
Swap: 2056300 297080 1759220AFTER TESTS ARE COMPLETED (PHP SCRIPT IS FINISHED)
Mem: 1035436 895352 140084 0 87944 686372
Swap: 2056300 297312 1758988top -b -n 1 RESULTS:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
BEFORE RUNNING THE TESTS:
28917 root 18 0 25584 9872 5928 S 0.0 1.0 0:00.09 httpd
28919 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28920 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28921 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28922 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28923 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28924 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28925 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28926 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpdDURING THE TESTS (AFTER MEMORY ALLOCATION, PHP STILL IS IN SLEEP):
28917 root 18 0 25584 9872 5928 S 0.0 1.0 0:00.09 httpd
28919 apache 18 0 110m 91m 2248 S 0.0 9.1 0:00.29 httpd
28920 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28921 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28922 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28923 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28924 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28925 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28926 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpdAFTER TESTS ARE COMPLETED (PHP SCRIPT IS FINISHED)
28917 root 18 0 25584 9872 5928 S 0.0 1.0 0:00.09 httpd
28919 apache 18 0 25672 6376 2356 S 0.0 0.6 0:00.31 httpd
28920 apache 18 0 25672 6376 2356 S 0.0 0.6 0:00.32 httpd
28921 apache 18 0 25672 6376 2356 S 0.0 0.6 0:00.33 httpd
28922 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28923 apache 17 0 25672 6376 2356 S 0.0 0.6 0:00.32 httpd
28924 apache 18 0 25672 6376 2356 S 0.0 0.6 0:00.27 httpd
28925 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpd
28926 apache 25 0 25584 4972 1004 S 0.0 0.5 0:00.00 httpdSCRIPT:
ini_set("memory_limit","256m");
$aa = array();
$total = 0;
for ($i = 0; $i < 9; $i++) {
$tc = chr(rand(65, 85)) . chr(rand(65, 85)) .chr(rand(65, 85)) .chr(rand(65, 85)) .chr(rand(65, 85));
$aa[$i] = str_repeat($tc, 2000000);
$total += strlen($aa[$i]);
}
print "<h1>$total</h1>";sleep(240);