Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


I ran your code (after a little clean-up) out to:

Record counter => 335700
And I verified the real memory usage as '1776MB' constant. I verified this with 'top' and with:
'/bin/ps -o rssize -p $$'
I used the latest Debian Linux 2.6.32 distribution and used perl 5.12.2 for the test. I did not use 'Proc::ProcessTable', so I can't say whether that is part of your problem. I also deleted the 'sleep( 10 );' since I didn't see any value in waiting 10 seconds to see the screen fill up immediately again.

Some suggestions:

  • perl5.8.8 is rather old.
  • use strict and use warnings ( You need more 'my's in your code
  • Consider using a 'log' file for incrementing information.

From this test, your problem isn't the hash growing. It could be your system or the system's perl that's giving you the problem.

Good Luck!

Update: I remembered I had some AIX systems with perl5.8.8 and I ran the code to 'Record counter => 10320' and the memory usage stayed as '1940MB'. So it doesn't seem to be a problem on the AIX perl5.8.8 either

Update2: My "MB" in above should be "KB" as the way 'top' and 'ps' return the information.

"Well done is better than well said." - Benjamin Franklin

In reply to Re: Memory issue with Hash by flexvault
in thread Memory issue with Hash by nowise

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (4)
    As of 2018-05-25 23:30 GMT
    Find Nodes?
      Voting Booth?