Practical mod_perl / HTML Version / books


previous page: 22.3.9. Callback called exitpage up: HTML Version of the booknext page: 22.3.11. syntax error at /dev/null line 1, near "line arguments:"

22.3.10. Out of memory!


Search







modperlbook.org


 HTML Version


 PDF Version


 Download Code


 Table of Contents


 Errata


 mod_perl2 User's Guide


 Sitemap





Add to Google



Creative Commons License


Written by
Eric Cholet (Logilune)
and Stas Bekman (StasoSphere).

Hosted by ibiblio.org.




























If something goes really wrong with your code, Perl may die with an "Out of memory!" and/or "Callback called exit" message. Common causes of this are infinite loops, deep recursion, or calling an undefined subroutine.

If -DPERL_EMERGENCY_SBRK is defined, running out of memory need not be a fatal error: a memory pool can be allocated by using the special variable $^M. See the perlvar manpage for more details.

If you compile with that option and add use Apache::Debug level => 4; to your Perl code, it will allocate the $^M emergency pool and the $SIG{_ _DIE_ _} handler will call Carp::confess( ), giving you a stack trace that should reveal where the problem is. See the Apache::Resource module for the prevention of spinning httpds.

Note that Perl 5.005 and later have PERL_EMERGENCY_SBRK turned on by default.

Another trick is to have a startup script initialize Carp::confess( ), like this:

use Carp ( );
eval { Carp::confess("init") };

This way, when the real problem happens, Carp::confess doesn't eat memory in the emergency pool ($^M).

 

Continue to:

  • prev: 22.3.9. Callback called exit
  • Table of Contents
  • next: 22.3.11. syntax error at /dev/null line 1, near "line arguments:"

Tags

mod_perl, modperl, Apache, perl, cgi, html, mod_perl, e-commerce, scalability, free, open source, OSS, apache, squid, high availability, modperl, linux, unix, Web, www, mod_perl, webserver, admin, apache, book, webmaster, tools, modperl, guide, docs, documentation, help, mod_perl, perl, information, apache, script, errata, eric cholet, perl, apache, mod-perl, stas bekman, mod_perl, cool, perl, Apache, performance, speed, choice




Other projects to check out: meta-religion.com is for those interested in Religious, Spiritual and Esoteric Phenomena. i-want-a-better.com is a community of people discussing what they would like to be improved in their lives and things they use and interact with. You may also want to find a healer in your area or read articles on variety of topics.






TOP
previous page: 22.3.9. Callback called exitpage up: HTML Version of the booknext page: 22.3.11. syntax error at /dev/null line 1, near "line arguments:"

© 2007 StasoSphere

[ Privacy Policy ] [ Terms of Use ] [ About Authors ] [ Search ]

Last modified Wed May 7 06:27:44 2008