Re: Parser produces Out of Memory error on HP-UX but not on Windows XP

[email protected] (Ron Smith) Fri, 11 Aug 2006 11:01:25 -0700
Newsgroups perl.recdescent
Organization Noitazinagro
Message-ID <[email protected]>
Buehl, Reiner (HPS EMEA GD-C&I) wrote:
> Hi all,
> 
> on HP-UX, my Parse::RecDescent parser dies with an Out of Memory error.
> If I run the same skript with the same input on a Windows XP system
> (with
> less Memory!) it works fine. I did check the ulimit values but could not
> find any user-limitations. Is there a way to solve this?
> 
> Best regards,
> Reiner.

I have encountered the same thing.  There are two possible explanations:

You have a memory leak.  This can come about when you create references 
to lexical variables that go out of scope and you fail to clean them up. 
  If you have a pointer to a structure and both the pointer and 
structure go out of scope, they cannot be garbage collected because the 
structure's reference count never decrements to zero.

You are on the hairy edge of using all resources.  The two platforms 
allocate memory differently (and recall it is not the amount of memory 
you have, it is the total size of the swap space). If it turns out that 
HP-UX uses memory inefficiently in this case, you could easily find 
yourself in a magic zone where a test case passes on one and fails on 
the other.

I suspect the memory leak.  That was always my problem...