in reply to Out of memory.

I suspect that your attempt to post your data got truncated.

Downloading what ended up on the site and sticking it in a file results in just over 63k of data which is suspiciously close to the 64K limit. And when I run your code against that file, it runs to completion. The output finishes with:

18321 of 18322 99.99 ADD VAR: 9166 STACK: 8: 4 7: 4 6: 989 5: 4 4: 151294 3: 47 2: 8795 1: 17 18322 of 18322 100.00 ADD VAR: 91 STACK: 9: 2 8: 4 7: 4 6: 989 5: 4 4: 151294 3: 47 2: 8795 1: 17 E: Not everything processed. 9 items in the stack. ALL PATHS FORM: 91

And the memory usage doesn't get 4mb for teh entire run?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Out of memory.
by dneedles (Sexton) on Oct 22, 2008 at 01:16 UTC
    Sounds like it did get truncated. The stack at the end was because some operations in the postfix notation got truncated at the end. I ran the program and outputed the array before the join was performed. The output was 500 or so megs. I suspect I might have hit some limit on string size or other limit. The memory usage on the Windows XP box ran close 1.5 gig for the perl process. Is there any cleaner way to do this that will not greatly impact performance? (The join cut the time to 1/60th over string appending.) Or is there a nice package to "page" to file parts of an array before the memory limit is hit?
        The postfix equation is 113,957 bytes. When it runs the final array before the join that results in the Out of memory error is 513,422,726 bytes. The solution is deterministic so the problem can be recreated from the 113,957 bytes.
        The postfix file that feeds the program is 113,957 bytes. The array right before the join that results in the memory error is 513,422,726 bytes. The program can be run to recreate the problem everytime on Windows XP box with 2gig of RAM running PERL 5.10.0 build 1003 by ActiveState.