Re: Memory issues
- From: "Peter J. Holzer" <hjp-usenet2@xxxxxx>
- Date: Sun, 30 Mar 2008 14:37:41 +0200
On 2008-03-29 13:55, jm <jm@xxxxxxxxx> wrote:
Joost Diepenmaat a écrit :[...]
jm <jm@xxxxxxxxx> writes:
Based on the fact that perl contains many memory leaks,
It doesn't.
I wrote a sample of code to illustrate the issue.
Calling function aa (one or several times) makes a memory leak (or
memory empreint) of 150 Mbytes.
I mean that once I called this function I do not know how to free those
150 mega bytes, but if I call this same function again I will not loose
more memory.
Then it's not a memory leak. A memory leak is when memory which has been
allocated cannot be (re)used. But in your case it can be reused (and is,
if you call the function again).
Perl is certainly wasteful with memory - The data structures have a lot
of overhead, and it often doesn't free memory because it might need it
again later - but AFAIK perl itself doesn't leak. (Perl programs often
leak - the garbage collector cannot detect cycles, for example, so
the programmer has to remember to do that).
hp
.
- References:
- Memory issues
- From: jm
- Re: Memory issues
- From: Joost Diepenmaat
- Re: Memory issues
- From: jm
- Memory issues
- Prev by Date: Re: Memory issues
- Next by Date: Re: Memory issues
- Previous by thread: Re: Memory issues
- Next by thread: Re: Memory issues
- Index(es):
Relevant Pages
|