#543 memory leak in write_png

v1.0 (example)
closed-fixed
nobody
None
5
2013-06-11
2013-05-23
Martin Svec
No

Calling write_png repeatedly keeps memory filling up
(In IDL it is fine)

pro bug
while 1 do begin
tv, fltarr(400,600)
help, /mem
endwhile
end

GDL> .compile bug
% Compiled module: BUG.
GDL> bug
% Compiled module: WRITE_PNG.
heap memory used: 4465632, max: 4465632, gets: 557, frees: 243
heap memory used: 5185648, max: 5185648, gets: 635, frees: 320
heap memory used: 5905664, max: 5905664, gets: 713, frees: 397
heap memory used: 6625680, max: 6625680, gets: 791, frees: 474
heap memory used: 7345696, max: 7345696, gets: 869, frees: 551
heap memory used: 8065712, max: 8065712, gets: 947, frees: 628
heap memory used: 8785728, max: 8785728, gets: 1025, frees: 705
heap memory used: 9505744, max: 9505744, gets: 1103, frees: 782
heap memory used: 10225760, max: 10225760, gets: 1181, frees: 859

Discussion

  • Martin Svec

    Martin Svec - 2013-05-23

    the same happens with write_jpeg, etc..

     
  • Alain C.

    Alain C. - 2013-05-28

    I do not see the relation to read_jpeg/write_jpeg in your code ! Could you check it ?

    may be it is due to memory leak in TV ??

    but I cannot reproduce on machines around, looking at the "top" output.

    We also know we have a problem in the way we got hte memory on some OS/hardwares (expecially 64bits linux), help welcome !

    Alain

     
  • Martin Svec

    Martin Svec - 2013-05-28

    Thanks for noticing, a correction follows:

    pro bug
    while 1 do begin
    write_png,'pokus',bytarr(400,600)
    help, /mem
    endwhile
    end

    You can replace write_png with write_jpeg or write_bmp
    Is it clearer now? Please advise

     
  • giloo

    giloo - 2013-05-28

    test file for both versions of bug

     
  • giloo

    giloo - 2013-05-28

    Added a test file below.
    No change in heap memory used (as reported by help,/mem) on my mandriva 64 bit, nor in external 'top', for tv or write_png.

     
  • Martin Svec

    Martin Svec - 2013-05-28

    To complete the information: when writing images, memory grows in "top", too.

    On this system:
    Ubuntu precise (12.04.2 LTS)
    kernel 3.2.0-43-generic #68-Ubuntu x86_64 (64-bit)

    GDL built from CVS:

    GDL> help,!gdl,/struct
    ** Structure !GNUDATALANGUAGE, 2 tags, data length=16:
    RELEASE STRING '0.9.3 CVS'
    EPOCH LONG 1369432800

     
  • Alain C.

    Alain C. - 2013-05-31

    following Valgrind, we do have a problem in internal GDL Transpose.

    Alain

     
  • Alain C.

    Alain C. - 2013-06-07

    The problem was solved by Marc. It is in the CVS.

    Valgrind just indicate possibly lost mem, but a Guard was missing in Magick related code. Done.
    Another small but clear problem of mem. leak was solved in Transpose.

    Alain

     
  • Martin Svec

    Martin Svec - 2013-06-07

    Just compiled, and it works now good :)
    Thanks!

     
  • Alain C.

    Alain C. - 2013-06-11
    • status: open --> closed-fixed
    • Group: --> v1.0 (example)
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks