Richard Davey takes a look at some of the resource levels used for creating an image with GD in his latest blog entry:
While working on a project I noticed some interesting issues regarding GD images and the amount of memory they take up simply down to where you store them in your PHP script. If you are working with GD a lot then reading this short entry might save you some time / RAM! Update: I've also discovered something very interesting relating to autoloading classes, which again is related to memory allocation.
He was setting up to make a thumbnail from an image and thought to check some benchmarks on memory usage after three different methods:
- normal, procedural code
- putting the image resource into an object array
- storing the image resource in an object variable