Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 22nd, 2005, 10:15 AM
fredforsyth.nospam@gmail.nospam.com
Guest
 
Posts: n/a
Default GD fns and memory leak

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)

  #2  
Old December 22nd, 2005, 08:15 PM
kevincw01
Guest
 
Posts: n/a
Default 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 ?_.

  #3  
Old December 22nd, 2005, 09:45 PM
Fred Forsyth
Guest
 
Posts: n/a
Default 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]

  #4  
Old January 7th, 2006, 08:15 AM
kevincw01
Guest
 
Posts: n/a
Default Re: GD fns and memory leak

what does it return, true or false?

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles