News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

UMumble.com:
Working with memory
February 14, 2012 @ 08:44:02

On the UMumble blog there's a recent post looking at memory consumption in PHP applications - what PHP does for you when managing how it uses your system's memory and what you need to worry about in your code.

There is a widespread view that the ordinary PHP developer does not need to control memory management, but "controlling" and "knowing" are slightly different concepts. I will try to throw light upon some aspects of memory management when working with variables and arrays, and some interesting pitfalls of the internal optimization of PHP. As you can see, the optimization is good, but if you do not know exactly how it is optimized, you might meet the pitfalls, which can make you pretty nervous.

They talk about some of the basics - how variables are stored in hash tables and how this helps memory consumption - as well as using the memory_get_usage method to find your current consumption. This is show for both regular strings and arrays, comparing larger data (and assigning it multiple times) to simpler structures. They also mention how PHP handles memory usage in passing by reference and copying of values.

0 comments voice your opinion now!
memory consumption tutorial usage management internals


blog comments powered by Disqus

Similar Posts

PHP-GTK Community Site: Building a submenu in a GtkMenubar

ThinkPHP Blog: Practical Testing PHP Applications with Selenium

Web Development Blog: Tutorial: FTP Upload via cURL

PHPMac.com: Building and Installing Apache 2.2.2 and PHP 5.1.3 (or 5.1.4) on Mac OS X 10.4.6

Pierre-Alain Joye's Blog: ext/filter, API frozen (!) and fixes, 0.11.0 is out


Community Events





Don't see your event here?
Let us know!


library release symfony podcast conference version tool introduction opinion series list security framework community voicesoftheelephpant interview artisanfiles language composer laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework