Hello Monks!

I've recently discovered the IPC::Shareable module. It seems to really fit a need I have in one of my present projects. However, in using it, I'm finding that my code is crashing a lot whenever the hash that I am tying execedes the amount of space that I am allocating for it. :(

Questions:

  1. Is there any way to find out how much actual memory is being used by an un-tied hash? I'd like to be able to benchmark the object that I'm using to try to find out an appropriate size to specify when tying it. I know you can find out the number of keys and buckets, but that doesn't really help much in this case.
  2. Is there any way to find out what percentage of the allocated memory an IPC::Shareable object is using?
  3. Ideally, I'd like to be able to monitor how close I am to execeding the allocated memory bounds and then re-allocating a larger memory space when that happens. Is this possible?

Thanks in advance for any pointers!


In reply to Determining size of an IPC::Shareable object by ehdonhon

Title:
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, details, 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, summary, 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.