GD fns and memory leak

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a class for manipulating images, making thumbnails etc. When it
under Apache, I find that each process is using up about 50M more than
it started.

I have three lines of code that show a similar problem:

        $imNew = ImageCreateTrueColor(3000,2000);
        ImageJPEG($imNew, '', 75);

Without the ImageJPEG line, a newly created Apache process goes up by a
100K, which I can understand. Add in the ImageJPEG line and it goes up
30M. Surely the memory should be released when the image resource is

I have Apache 2.2.0 and PHP 4.4.1 running under Apache. Has anyone else
this?? (It also occurs under Apache 2.0.54 and PHP 4.4.0)

Thanks in advance
Fred Forsyth
(remove .nospam to reply by email)

Re: GD fns and memory leak

what does ImageJPEG() return?  Is it possible, the return object is
saved to some hidden variable like in perl's ?_.

Re: GD fns and memory leak

The ImageJPEG() fn returns a bool value, so if it is creating anything
it should clear it as far as I can see.

kevincw01 wrote:
Quoted text here. Click to load it

Re: GD fns and memory leak

what does it return, true or false?

Site Timeline