Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: Out of Memory Error -- Possible Leak?

by emilper (Novice)
on Dec 14, 2005 at 11:59 UTC ( #516590=note: print w/replies, xml ) Need Help??

in reply to Re: Out of Memory Error -- Possible Leak?
in thread Out of Memory Error -- Possible Leak?

maybe it's because the garbage collector does not have time to run ...
  • Comment on Re^2: Out of Memory Error -- Possible Leak?

Replies are listed 'Best First'.
Re^3: Out of Memory Error -- Possible Leak?
by robin (Chaplain) on Dec 15, 2005 at 12:37 UTC
    That isn't possible, because Perl doesn't use a separate garbage collector. It simply reference-counts all its data (scalars, arrays, hashes etc) and frees an item when its reference count drops to zero.

    (This is why circular data structures cause memory leaks.)

      then how do you explain this ?


      perl -e ' use Tk; while (1) { my $top = new MainWindow; }'

      it will fill your RAM at a rate of about 1MB per second ...

        If you're right about that, then it's a memory leak in the Tk module, which you should report to its maintainers. That shouldn't happen, and it's not caused by anything that Perl itself is doing.

        Seriously, I do know how Perl's garbage collection works. I'm not just pretending. :-)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://516590]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2023-12-10 13:31 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (40 votes). Check out past polls.