Re: Memory issues



On Mar 29, 7:40 pm, jm <j...@xxxxxxxxx> wrote:
jm a écrit :



Modifying a little bit again the script, and checking execution with
ltrace, I observed malloc is called 1871 times when free is just called
922 times.
Isn't it an issue?

and did:

ltrace perl essai.pl 2>&1 | grep 'malloc\|free\|realloc' | perl
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.


.



Relevant Pages

  • Re: Memory issues
    ... this result of memory leaks: ... 10 Mbytes data are not freed. ... I don't know much about the perl garbage collector, ...
    (comp.lang.perl.misc)
  • Re: Memory issues
    ... I observed malloc is called 1871 times when free is just called ... this result of memory leaks: ... 10 Mbytes data are not freed. ... sub aa ...
    (comp.lang.perl.misc)
  • Re: netbeans or java ?
    ... > thought Java programs didn't need to worry about memory leaks because of the ... > garbage collector. ... > Is the JVM at fault for the memory leaks? ... PGP Key available from your friendly local key server ...
    (comp.lang.java.programmer)
  • Re: interface programming
    ... ICar pGenericCar = carFactory.createCar; ... Without worrying about memory leaks. ... delete this heap object since C++ interfaces have no ctor or dtor? ... the garbage collector will work exactly yhe same as in C#. ...
    (microsoft.public.vc.language)
  • Re: Managed VC++ crashing in debug build caused memory leaks
    ... I was surprised to see memory leaks in our application when it crashed ... Does the garbage collector not work in debug build ... can also allocate from the native heap. ...
    (microsoft.public.dotnet.languages.vc)