Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^6: Handling HUGE amounts of data

by Dandello (Beadle)
on Jan 31, 2011 at 20:49 UTC ( #885356=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Handling HUGE amounts of data
in thread Handling HUGE amounts of data

Actually I am using strict - the my declaration for $x, $y, and $z was elsewhere. And this was my original before I got creative:

sub popnum1 { ( $x, $y, $z ) = @_; if ( $y == 0 ) { $aob[$x][0] = $initial + $z; } else { if ( substr( $aod[ $y - 1 ], $x, 1 ) ne 'a' ) { $aob[$x][$y] = $initial + $z; } else { $aob[$x][$y] = $z + $aob[$x][ $y - 1 ]; } } return $aob[$x][$y]; }

I've moved the Perl/Tk done snippet into a different script and running the full load still throws an 'out of memory' during what should be cleanup. Now I have to track down exactly where.


Comment on Re^6: Handling HUGE amounts of data
Download Code
Re^7: Handling HUGE amounts of data
by BrowserUk (Pope) on Jan 31, 2011 at 20:52 UTC
    Actually I am using strict - the my declaration for $x, $y, and $z was elsewhere.

    Well that's just silly.

    Now I have to track down exactly where.

    If you scoped your variables properly, it might make that task easier.


    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.

      A little sleuthing indicates it's not a problem with scoping the variables. But I'm still digging.

      The script is throwing the 'out of memory' after the output file is closed, after that entire subroutine has returned to main.

      In fact, it's throwing the 'out of memory after dataout.pl has called the next script in the chain.

      That would indicate it's throwing 'out of memory' during clean-up somewhere, right?

      Or maybe it's doing it because it's on Windows.

        I'd suggest that you add a line: print 'Done'; <STDIN>; just before the end of the program. When the prompt appears, pop up he task manager (or better, Process Explorer if you have it), and monitor the memory usage at that point. Then, leaving the manager window visible, hit enter on the command session and watch what happens.

        Personally, I've never seen the situation where 'out of memory' occurred during clean up, but that doesn't mean it couldn't happen.

        But the thing that is baffling me is why you are still running out of memory now you've reduced the memory usage? Perhaps now would be a good time to post the latest version of your code and see if other people (me) can reproduce your findings.

        Remember to include the initial input file--or sufficient information to allow us to accurately mock it up--so that we can run the code in a realistic fashion.


        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://885356]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2014-04-18 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls