GD fns and memory leak

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fredforsyth.nospam@gmail.nospam.com

    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 = ImageCreateTrue Color(3000,2000 );
    ImageJPEG($imNe w, '', 75);
    ImageDestroy($i mNew);

    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

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

    Comment

    • Fred Forsyth

      #3
      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]

      Comment

      • kevincw01

        #4
        Re: GD fns and memory leak

        what does it return, true or false?

        Comment

        Working...