in reply to Re: memory (leaks and management)
in thread memory (leaks and management)

Thanks. I will have a look at Devel::Size.
Other than that, not necessarily in order of relevance :
- Most of the modules are up-to-date, or else modules I have used before without noticing leaks of this magnitude
- The program is difficult to whittle down, as one step generally depends on the results of the steps before. For instance, the program takes a MS-Office document and converts it to OpenOffice in one step, then in the next step uses the OpenOffice version to extract the text. So I cannot really strip the first part and run the second only.

I have noticed the following funny thing : at some point, I run an external utility using system(). It can take a while to run, during which my program waits for the return of the system() call. Well, sometimes during that wait, the memory used starts decreasing, as if Perl was using the time to do some cleanup. Is this possible, or am I having hallucinations ?

A possibly related question : when exactly does Perl decide to embark on a cleanup round ? and is it possible to provoke it ?

Replies are listed 'Best First'.
Re^3: memory (leaks and management)
by dk (Chaplain) on Mar 28, 2007 at 10:02 UTC
    I don't think it is Perl, (well yes, perl does call free() once in a while), but rather win32 memory manager that keeps memory for the process for a while.

    As for whittling down, I'd suggest being a bit more creative :) for example, yes indeed, you cannot take MS-to-OO transition out, but you can pre-create the OO documents that correspond to the MS ones, and change the program so that instead of running the actual conversion, it loads the corresponding OO doc from the disk. The same is valid for OO-to-text - comment out the OO part, but save the text separately and use in in the reduced program.

    hope this help, /dk