dlublink Posted December 21, 2010 Share Posted December 21, 2010 Hello, I have three "servers". 2 machines with 64-bit dual processor, 12 cores, 24 threads at 2.80GHz each. 8 gigs of memory each and a bunch of disks. 3 SATA 10,000k disks in raid 1 with hot spare each. We'll call these two "production" I have a third machine P4 2.40GHz with 500 megabytes of memory and a 8gig ide disk. We'll call this one "development" Both are running php5 under lighttpd fast cgi and APC. Here's the mystery, both have exactly the same code ( synched with svn ). On the production machines, the reference page takes 16megabytes of memory. On the development machine, the same reference page takes 8 megabytes. I have run the test several times. I am using the same database ( mysqldump ) on both machines. Why are the production machines taking twice as much memory as the development machine ? Production machines are running cracklib mod and 3rd machine is running xdebug. I disabled both so they'd be the same. Still have the difference. I did an phpinfo() on both machines. The differences were with the xdebug and cracklib libraries ( which I reenabled before the phpinfo()), server name, IP. I disabled apc cache on both machines, thinking this was my problem, the memory consomption stays the same. What is causing such a big difference in memory consomption? Is there a cachegrind for memory usage ? Any ideas where to look? Ubuntu 10.04 LTS is the O/S Thanks, David Quote Link to comment https://forums.phpfreaks.com/topic/222261-memory-consumption-difference-between-three-machines/ Share on other sites More sharing options...
xylex Posted December 21, 2010 Share Posted December 21, 2010 Are both machines using a 64-bit OS? If your production is 64-bit and your dev is 32-bit, that would do it. And you're checking your memory usage with memory_get_peak_usage()? Quote Link to comment https://forums.phpfreaks.com/topic/222261-memory-consumption-difference-between-three-machines/#findComment-1149809 Share on other sites More sharing options...
dlublink Posted December 21, 2010 Author Share Posted December 21, 2010 Are both machines using a 64-bit OS? If your production is 64-bit and your dev is 32-bit, that would do it. Having a 64-bit OS would cause PHP's memory consomption to double?!??! And you're checking your memory usage with memory_get_peak_usage()? I was using memory_get_usage() not memory_get_peak_usage(). On both machines the difference is about 200,000 bytes ( between memory_get_usage and memory_get_peak_usage ). The production ( 64bit ) machines use about 15 megabytes and the development ( 32bit ) machine is at about 8.5 megabytes. I am convinced there is something else going on, it does not make sense to me that there is such a large difference in memory consomption. David Quote Link to comment https://forums.phpfreaks.com/topic/222261-memory-consumption-difference-between-three-machines/#findComment-1149891 Share on other sites More sharing options...
xylex Posted December 21, 2010 Share Posted December 21, 2010 Having a 64-bit OS would cause PHP's memory consomption to double?!??! Yes, it would. Almost all of your pointer sizes are doubled since what used to take 32 bits takes 64 bits. http://en.wikipedia.org/wiki/64-bit#Specific_C-language_data_models Quote Link to comment https://forums.phpfreaks.com/topic/222261-memory-consumption-difference-between-three-machines/#findComment-1149912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.