Welcome Guest, Not a member yet? Register   Sign In
odd memory_usage() results
#7

[eluser]WanWizard[/eluser]
[quote author="jedd" date="1252630314"]If you're running a GNU/Linux distro, pick one of the larger-memory laptops, and force the kernel to utilise less memory (mem= at boot). If you're using MS - no idea if you can fake it similarly. There might be a correlation between vm, not just physical RAM, so you might try forcing a smaller-memory box up with a hideous amount of swap, and vice versa.[/quote]
No MS in this shop. :-) I'll see if I can produce some results this way.

Quote:I don't know if this is the case .. but from an academic point of view, it's actually pretty smart - to use more resources if they're available.
According to the manual, PHP reports the memory allocated by malloc(). The same code operating on the same data should allocate the same amount of memory. Regardless of what is available. Why would it allocate more? The only small fluctuation that I see can be explained by the actions taken by the sessions library, the extra memory allocated happens when the library is renewing the session (I see the extra query to update the session ID in the profiler output).

I found some possible explanation in Zend documentation, which state that when plenty of memory is available, the memory manager doesn't perform cleanup functions (p.e. memory allocated for variables that are no longer in scope and not explicitly unset) for performance reasons. Instead, all cleanup is performed when the script finishes (are part of the final cleanup). Since memory_get_usage() is executed before the cleanup, it would report include all garbage in memory, since it is still allocated. This also means that if I reduce memory on both test systems to the same amount, I should see more equal figures.

Quote:Does the elapsed_time inversely correlate with the memory usage figures you're getting out of the profiler?
Difficult to say. Processing the page typically takes 0.06 seconds on both machines, although occasionally it peaks to 0.11. These figures are roughly the same for both machines. Since it's no controlled environment (the machines are 'desktops' and typically run desktop applications at the same time (browser, email, etc...)), this doesn't say much...


Messages In This Thread
odd memory_usage() results - by El Forum - 09-10-2009, 04:53 AM
odd memory_usage() results - by El Forum - 09-10-2009, 06:57 AM
odd memory_usage() results - by El Forum - 09-10-2009, 09:40 AM
odd memory_usage() results - by El Forum - 09-10-2009, 11:00 AM
odd memory_usage() results - by El Forum - 09-10-2009, 12:56 PM
odd memory_usage() results - by El Forum - 09-10-2009, 01:51 PM
odd memory_usage() results - by El Forum - 09-11-2009, 01:54 AM
odd memory_usage() results - by El Forum - 09-11-2009, 02:32 AM
odd memory_usage() results - by El Forum - 09-11-2009, 06:12 AM
odd memory_usage() results - by El Forum - 09-11-2009, 10:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB