title: Is there a standard way for perl to behave when it runs out of memory?
body: <p><strong>Is there a standard(ish) way for a Perl interpreter (aka "perl") to behave when it runs out of memory? Is it documented/specced-out in any way? Coded in some uniform way?</strong></p>
  
  <p>I'm especially interested in any standards which are expressed as covenant to Perl code being run - e.g., will <code>die</code> be called? Will <code>END</code> block be executed? Etc...</p>
  
  <p>I'm fine with both an "theoretical" answer (e.g. some sort of generic "this is what perl code ought to do in general on out-of-memory" mission statement document from Larry/P5P/etc..., even if not 100% of malloc() calls follow this rule); or a "practical" statement (e.g. all malloc() calls in Perl are wrapped into a generic "allocate_memory" function which uniformly handles all failures).</p>
  
  <p>It may be possible that the answer depends on what specifically causes out of memory (e.g. a request for more memory for Perl code's data structure vs. memory allocated by internal Perl code unrelated to explicit "need to store more data" logic in Perl program).</p>
  
  <p>If the answer is extremely implementation dependent, assume perl for Solaris/Linux,and narrowing down to any recent stable version (5.8 to 5.16) is acceptable.</p>
  
  <p>The question is limited to standard Perl interpreter, however you wish to define that as far as pre-compile configuration (e.g. perl that comes with a major Linux distribution, or one compiled with all defaults left alone, etc...).</p>
  
  <p><sub>NOTE: This question came out of Gilles's comment to <a href="https://stackoverflow.com/questions/13234866/can-a-perl-system-call-ever-die#comment18042068_13234866">another Q</a></sub></p>