in reply to releasing GD in CGI script?

It appears that values of the graph double upon execution which makes me surmise that the underlying object is not released upon termination of the script.

If you use normal CGI scripts, and not something like mod_perl or FastCGI, that's virtually impossible. The memory is cleared by the operating system when the script terminates, Perl objects can't survive that.

Replies are listed 'Best First'.
Re^2: releasing GD in CGI script?
by Anonymous Monk on Dec 18, 2008 at 01:56 UTC

    You're correct. I should have been more explicit. This is a ModPerl script

    Is there a way to force memory cleaning?

      Usually you don't need this. Just use strict; use warnings; and make the variable that holds the GD object a lexical variable, then it will be cleaned automatically on scope exit.

      If you can't figure it out, you can still say undef $gd;