Since a whole day went by with no answer to this, I'll give you the best I can do (and hopefully spur some discussion on the topic). If I think memory is going to be a concern with an item in my program, I would build a stop point just before that object was created (something in the application that would wait for the user to hit a key). I would (assuming I'm on linuxunixposix) then run top in a second window and wait for the size of my perl process to stabilize after hitting the stop point. Then going back to the script, continue-- all the while keeping an eye on the top window to see what happens. This is not an exact method, but it's useful for watching for memory leaks and getting a sense for how much memory your larger structures are eating up. I've only used it to watch my scripts as I built destructors into my Tk applications, but never to actually measure the absolute size of a hash.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|