-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak fixes pt. 2 #1113
Memory leak fixes pt. 2 #1113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested this, builds and runs seemingly same as before if not monitoring RAM consumption. I found that on the clock, I was still able to run up panel RAM usage by rapidly opening and closing the calender, by a little if no location is set and "locations" is closed, and my a bit more (a couple MB maybe) if a location is set and "locations" is kept showing above the calendar itself.
Also, we still have that big leak on hovering on an open window's button in the taskbar if and only if previews are enabled: RAM use goes up as much as 50MB on showing the preview and does NOT go back down until another preview is shown, in which case it simply changes to the usage expected for that particular preview. That's also a LOT of RAM for that small preview image. Note that the WM in question is compiz-reloaded in this test.
Still, as I said before, every bit helps and all these will just have to be found one at a time.
Note that my test was with all possible applets built in-process |
Thanks for the extensive review, @rbuj. Generally I try to keep changes at minimum and preserve existing data structures. Not sure what the specific MATE Desktop devel guidelines look like, I can go deeper and include slight local refactoring and/or code style cleanup if that's desired. For instance my commit dd5148c is a good candidate for a better list data structure rewrite but I wanted to preserve the existing array for the time being. |
@tbzatek Don't worry about that. When I do a PR review, often I see things that need to be improved ;) |
How do I turn thumbnails on while I'm on it? No compiz here though. I also tend to believe there's a leak somewhere in Pango. While this looked like a static initialization (font cache?) it shows up way too often.
|
To enable the thumbnails in the window list, right-click on the window list's handle (to the left of the first window button), and select "preferences" in the popup menu. Check the "Show thumbnails on hover" box in "Window Thumbnails" and close the dialog. This is NOT applied until the panel is restarted(no update callback or one that does not work), so run I just verified I get the same memory leak on the window thumbnails when running marco. Thumbnails are made by wncklet, using data provided by the WM, so this is no suprise. |
And use stack-allocated GVariantBuilder for temporary storage.
The PANEL_GLIB_STR_EMPTY() macro returns TRUE even when the memory was allocated yet the string was empty, so do explicit free() here.
Overwriting an already allocated memory.
Iteration over a linked list should be done over a side control variable and list head needs to be preserved for proper list free.
The gtk_tree_view_set_model() adds its own reference.
The gtk_tree_model_get() duplicates memory or adds a reference and any data need to be freed explicitly.
Let the GError ownership on the async finish method call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's awesome, I have no words to express our gratitude for everything you have done.
Amazing work @tbzatek |
Ah, had an old Anyway, got it working, I do see some memory consumption increase (~550 MB) but there's nothing obvious in the code nor reported by Valgrind other than
The |
I think I'm done with the fixes here, I'll keep running this branch for a couple of days to ensure it's stable. Please test my fixes, notably the changes in the clock applet are slightly intrusive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds and runs fine as of today, adding cities works same as in master, and yes we still have the leak on window thumbnails that libwnck was found responsible for. Still, every leak we can cork up here helps, and they will add up over time
Oh yeah I just found this fixes #1115 and the error dialog on dismissing the priviliges dialog for changing time zone in calendar now works fine |
Please don't keep in secret your findings. If you have identified memory leak in |
I think i will change the default of this previews to disable for fedora.
For myself i have patched
I think we need a function in |
That would be a |
The libwnck issue was not my finding, I learned of it from another
comment on this PR or a related discussion.
(edited to remove extra text from poorly functioning email reply/quote system)
|
@lukefromdc This was your post from your aproval 12 hours ago.
Edit: PS: Your posts becoming more and more confusing since you are using this crazy build-in quoting function. |
Note that I have had limited time due to the Black Lives Matter uprising in my country, in which I am a direct participant |
Merging as this reduces memory leaks, fixes a calendar bug, and has two approving reviews |
@mate-desktop/core-team This PR must be cherry-picked to 1.24 branch? |
Of course, fixing memleaks are always bug fixes. |
ok, done |
Another bunch of memleak fixes found by compiling applets in-process. The fixes from #1112 are not included in this branch.
I'm still seeing increasing memory consumption about 1MB an hour but nothing dramatic otherwise.