There may very well be a problem with SunOS. Since Solaris is the replacement for SunOS (do I have that right?), issues with one may be related to the other. The first usenet post below specifies Solaris, the second is SunOS and third both specify SunOS.
On 23 Oct 2000 20:50:22 GMT Ilya Zakharevich (ilya@math.ohio-state.edu) remarked... > Solaris build uses Perl's malloc() by default, which should be much
> more efficient than the Linux's one... But it may have happened that
> you got into some bug in Perl's malloc(). Check the footprint of your
> program as mstat() reports it.

Well, it's taken me a week to find time to build perl on the Sun machine (damn is it slow on that machine compared to building on my linux machine!).

Anyway, upgrading from 5.00503 to 5.6.0 made the memory leak go away. I'd like to do more research, but due to how long it takes to build perl and my lack of free time: case closed. (Now I have to convince the sysadmin to upgrade).

I'd be willing to do more research if needed.


I'm having trouble with my perl process bloating to >200M and it really shouldn't be. I wrote a perl program to process large files (up to 400M each). Each file is broken up into records. Once every 10-10000 records, I hit a record in the file which signals me to output some sort of summary and undef all arrays and hashes. Nevertheless, the process sometimes exceeds 200M in runtime size, where I would expect 10M to be sufficient, 50M tops.

I checked for silly things like

$x=pick_some_big_number(); $a[$x]=0;

Also, I don't create circular references.

I'd appreciate any clues for tracking down a "memory leak" of my own doing, or statements of the form "perl's garbage collector leaks by design. So rewrite your program to restart periodically".

Thanks in advance for any help!
Michael Niv.
niv@remove-if-not-a-spammer.unagi.cis.upenn.edu
------------------------------------------------------------------------------
% perl -v

This is perl, version 5.003 with EMBED built under solaris at Nov 2 1996 11:18:11 + suidperl security patch

Copyright 1987-1996, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5.0 source kit.

% uname -a
SunOS dali 5.6 Generic sun4u sparc SUNW,Ultra-Enterprise


Gurus, I have attached the top and vmstat -S 5 output below. I have enough swap space and decent amoount of memory left. However, vmstat out put shows 43 swapped processes. My users are complaining about the performance.

What could be the problem for this?
I will summarize.
TIA
Navi

OS is SunOS cash-bench 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-2


Cheers,
Ovid

Join the Perlmonks Setiathome Group or just go the the link and check out our stats.


In reply to (Ovid) Re: PERL memory leak? by Ovid
in thread PERL memory leak? by Anonymous Monk

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.