in reply to Out of memory! in CGI

Two ideas:

You could check if the webserver process has the same ulimits as the shell you ran ulimit from.  For this, just have a CGI script run ulimit and return its output.

As you get the "out of memory" after the last instruction of the worker script, it could be that some cleanup code in destructors, END blocks, or the Perl interpreter itself (I suppose the worker is a Perl script, too), is using more memory than available at the time.  So you could try POSIX::_exit to exit the process immediately, bypassing any cleanup.

Replies are listed 'Best First'.
Re^2: Out of memory! in CGI
by pkal (Initiate) on Feb 21, 2011 at 16:39 UTC
    Regarding ulimit - I did it earlier; the output from CGI is the same as from the shell.

    Regarding POSIX::_exit - it really makes a difference; there is no "out of memory" message when this function is called instead of normal exit. I am not yet sure if it is enough to solve the problem - it would be good to know what happens with the normal exit. But "out of memory" was gone. Thanks!