Memory leak in Index-Mode #287
Comments
I suspect you're right; but I do trust the libmagic usage, as that's a singleton we only open that particular library once. Testing magic is simplest, since you can run the sample code like so:
I'll create a debug-build and run that particular test under valgrind shortly. |
One of the problems right now is that we "leak" memory via all the singletons. They're not true leaks, but they show up as such. I suspect we should add a |
This ensures that any global objects are *definitely* cleaned and freeds when the process terminates. The intention is that this will allow real leaks to be detected more easily, via valgrind. This updates #287.
OK with those changes in place I can run
The output shows one definite leak:
Will experiment with doing more before terminating to see what leaks I can find, if any. I'm only really concerned with anything that |
This cleans up a little leak affecting all views/modes. This is part of #287
My testing now shows a leak of 28 bytes, from
The TODO:
|
Specifically we were leaking message-headers, via the call to g_mime_utils_header_decode_text, and we left a couple of messages around. This now allows me to open an index, read a few messages, and quit with only a leak of ~200 bytes. (Still need to work on that). This updates #287
Hopefully I need to stop for a few days, but if I've not fixed everything at least I've made real progress :) |
I think I've made enough changes here that this is a non-issue, but I'd welcome evidence to the contrary. |
Yesterday I compiled lumail with luajit to see if there are any speed improvements. The speedup is marginal, but I found out that the memory leak is lua related. I will try lua5.2 for comparison. |
It happens also with lua5.2. Are you experiencing this too or is it caused by my configuration ? |
I just don't see it, even under valgrind.. |
Ok then it has to be something with my own configuration. |
No need to apologize - if you're seeing leaking memory then that is definitely a bug. But unless/until I can see it myself I can't do too much about it. :( |
I experience a slow but steady growth in memory usage if lumail is kept open in
index-mode.
This is happens on both devices I use (current master).
A while ago I ran lumail through valgrind, but the output was massive and my
knowledge of valgrind little so I ignored it.
I expect the cause to be wrong usage of ether libgmime or libmagic. Reallocating
some objects without freeing the old ones.
The text was updated successfully, but these errors were encountered: