Re: Memory issues
- From: jm <jm@xxxxxxxxx>
- Date: Sun, 30 Mar 2008 01:12:59 +0100
smallpond a écrit :
On Mar 29, 7:40 pm, jm <j...@xxxxxxxxx> wrote:
jm a écrit :
Modifying a little bit again the script, and checking execution withltrace perl essai.pl 2>&1 | grep 'malloc\|free\|realloc' | perl
ltrace, I observed malloc is called 1871 times when free is just called
922 times.
Isn't it an issue?
and did:
observe_malloc_free.pl > memory.log
with observe_malloc_free.pl in mail bottom.
Hereafter, this result of memory leaks:
1 NULL is freed, but thats not a memory leak!
the rest can be read like this:
7 10 Mbytes data are not freed.
1 13 Mbytes data is not freed
8272 4 bytes data are not freed
9843 4080 bytes data are not freed
but I still do not know why...
I don't know much about the perl garbage collector,
but memory is not freed immediately when the ref
count goes to 0. 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. Memory use does
not continue to go up.
This is because I have only 500 Mbytes on my computer.
So I made a perl demo program which works within this limit.
Instead of a 10 MBytes string, you can (try to) use a 40 Mbytes string,
or a 100 Mbytes string.
And then, you will see if the garabage collector start at 200 Mbytes,
.... or not.
What I only showed with ltrace and observe_malloc_free.pl is that when
the program stops, garbage collector did not collected all garbage.
.
- References:
- Memory issues
- From: jm
- Re: Memory issues
- From: smallpond
- Re: Memory issues
- From: jm
- Re: Memory issues
- From: smallpond
- Re: Memory issues
- From: jm
- Re: Memory issues
- From: jm
- Re: Memory issues
- From: jm
- Re: Memory issues
- From: smallpond
- 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):