Sorry if I didn't phrase my question correctly.
I use the php function "memory_get_usage()" to see the amount memory allocated to PHP on a script I am running.
On server A I get around 2 MB. (CentOS 6, Apache 2.2.15) The same script on server B I get around 1 MB. (Mac OSX, Apache 2.2.22)
Where should I check, or how should I fine tune my apache or php settings on server A to have similar memory footprint on server B?
For example, does the memory foot print affected by the loaded php extensions?
I guess different environments will cause a script to consume different amounts of memory. I'm fairly sure that the more extensions loaded the more memory PHP will consume, so using only the ones you need is advised. You should start by comparing the versions of PHP and which modules are installed on each server.
If you're looking to increate the amount of memory a script can consume:
http://php.net/manual/en/ini.core.php
http://www.hostucan.com/webmaster-tutorials/increase-php-memory-limit
There's not too much you can do config wise if you have a script that has inefficient code, if you'd like to get more bang for your buck, you should look to see if you can make the code more efficient so that it consume less memory.