Re: Memory issues



On 2008-03-29 23:52, smallpond <smallpond@xxxxxxxx> wrote:
I don't know much about the perl garbage collector,
but memory is not freed immediately when the ref
count goes to 0.

This is wrong. When the ref count goes to zero, perl immediately calls
free.

free may decide to keep the memory around for a subsequent malloc call,
but that doesn't have anything to do with perl - only with your system's
malloc/free implementation (if you use the system's malloc, which is the
default on most platforms, I think).

When I run your program and watch with top, VM goes to 200 MB and
stays there for the whole run. That seems to be some upper bound
where the garbage collector is running.

Perl doesn't have a garbage collector which runs periodically.

hp
.



Relevant Pages

  • Re: Questions about Inline::C
    ... > use Perl's built in memory management. ... > a new Perl string scalar. ... is there is any danger with malloc() from within ... void foo (unsigned char* s, ...
    (comp.lang.perl.misc)
  • FAQ 3.16 How can I make my Perl program take less memory?
    ... How can I make my Perl program take less memory? ... system malloc or with Perl's builtin malloc. ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ...
    (comp.lang.perl.misc)
  • Re: Shifting Away
    ... >> alias, not exactly by ref. ... Perl does implement param passing via ... XC> possible to do anything within a sub that could clobber a param ... you pass refs if you want call by ref. ...
    (comp.lang.perl.misc)
  • Memory leak, DBI 1.55 + DBD::ODBC 1.13 + MS SQL 2000
    ... Recently I have bumped into a memory leak happening in DBI. ... My Perl build config: ... ActivePerl Build 819 ... 28671 Define PERL_NO_DEV_RANDOM on Windows ...
    (perl.dbi.users)
  • Re: why the perl docs suck
    ... allocate new memory, copy then free old? ... Perl getting to that complex computation. ... >> the granularity of a Perl push statment. ... >> you don't know that memory allocation is not contiguous! ...
    (comp.lang.perl.misc)