Connecting Tech Pros Worldwide Forums | Help | Site Map

GD fns and memory leak

fredforsyth.nospam@gmail.nospam.com
Guest
 
Posts: n/a
#1: Dec 22 '05
I have a class for manipulating images, making thumbnails etc. When it
runs
under Apache, I find that each process is using up about 50M more than
when
it started.

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

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

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

I have Apache 2.2.0 and PHP 4.4.1 running under Apache. Has anyone else
seen
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)


kevincw01
Guest
 
Posts: n/a
#2: Dec 22 '05

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 ?_.

Fred Forsyth
Guest
 
Posts: n/a
#3: Dec 22 '05

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:[color=blue]
> what does ImageJPEG() return? Is it possible, the return object is
> saved to some hidden variable like in perl's ?_.[/color]

kevincw01
Guest
 
Posts: n/a
#4: Jan 7 '06

re: GD fns and memory leak


what does it return, true or false?

Closed Thread


Similar PHP bytes