Menu

#757 suspected memory leak

open
nobody
General (289)
5
2011-09-29
2011-09-29
kiri
No

Left running for a day or few, the virtual memory consumed by geany+plugins increases by about 300MB.

I have several plugins enabled, so the leak could be in them as well.
I may try running without any plugins and post the results.

This is geany version 0.20 in Debian "unstable".

Discussion

  • kiri

    kiri - 2011-10-04

    Having run geany without plugins, the increase in virtual memory usage still happens. When geany is used, it happens in hours rather than days.

     
  • Nick Treleaven

    Nick Treleaven - 2011-10-04

    Thanks for the extra info. It would be interesting to see if you can notice whether using certain features increases memory usage. Also please try testing again now Geany 0.21 is out.

     
  • Anonymous

    Anonymous - 2011-10-04

    Also, I wonder if it's the tag manager stuff. Is it increasingly using memory just sitting there, or are you opening tons of big files and lots of tag files and stuff? I've had Geany use lots of RAM before but I had *lots* of files and *way* too many tag files loaded.

     
  • Lex Trotman

    Lex Trotman - 2011-10-11

    Whilst it is always possible that Geany has memory leaks, these symptoms are more indicative of fragmentation effects.

    Geany uses lots of small memory areas and a few large ones (the scintilla gap buffers), a recipe for fragmentation. As files are loaded and unloaded the large memory allocations tend to move to new areas as they are blocked from re-using previous allocations by intervening small allocations.

    This is a known behavior of the C/C++ allocators.

     
  • Nick Treleaven

    Nick Treleaven - 2011-10-11

    @elextr: It seems surprising that this could account for 300Mb, wouldn't that need a lot of opening/closing files?

    For temporary multiple string allocations we could use GStringChunk to help with fragmentation:
    http://developer.gnome.org/glib/2.28/glib-String-Chunks.html

    It's possible using g_slice_new instead of g_new may help fragmentation too, but I'm not sure how important this is, depends on context.

     
  • Lex Trotman

    Lex Trotman - 2011-10-13

    @ntrel: correct, this is re Geany using memory faster when being used

    I ran Geany all day without doing anything with it and did not observe any memory increase, but the Geany I was using grew steadily.

    I think probably most of the fragmentation is due to having three allocators in use, libc, Glib and libc++, and they not sharing or returning memory they acquire. This is likely to outweigh the cost/benefit of switching to g_slice given the effort required since types or sizes are needed in all frees.

    @dakiri, what filetypes are you using, there may be leaks in particular Scintilla parsers and tagmanager parsers.

     
  • kiri

    kiri - 2011-11-06

    I mainly use plain text and markdown. I guess I was using one or both at the time I took the measurements.

     

Log in to post a comment.