Skip to content
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

Fix memory leak #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix memory leak #88

wants to merge 2 commits into from

Conversation

alxvmr
Copy link

@alxvmr alxvmr commented Nov 2, 2024

Hello! 👋
When running dconf update, a large memory leak was detected:

[root@lenovo-93812 RPMS.hasher]# ps aux | grep mate-menu
aleksee+   48198  2.0  0.6 918548 106816 ?       Sl   11:17   0:01 mate-menu
root       48280  0.0  0.0   6064  2220 pts/1    S+   11:19   0:00 grep --color=auto mate-menu
[root@lenovo-93812 RPMS.hasher]# ps up 48198
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aleksee+   48198  2.0  0.6 918548 106816 ?       Sl   11:17   0:01 mate-menu
[root@lenovo-93812 RPMS.hasher]# dconf update
[root@lenovo-93812 RPMS.hasher]# ps up 48198
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aleksee+   48198 11.8  0.9 938980 151908 ?       Sl   11:17   0:12 mate-menu
[root@lenovo-93812 RPMS.hasher]# dconf update
[root@lenovo-93812 RPMS.hasher]# dconf update
[root@lenovo-93812 RPMS.hasher]# dconf update
[root@lenovo-93812 RPMS.hasher]# ps up 48198
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aleksee+   48198 31.9  1.4 1039960 234804 ?      Rl   11:17   0:40 mate-menu

The problem was that the application plugin was not releasing memory when regenerating due to references.

The attached commit fixes the situation - the application plugin is released from memory and the associated leak goes away.

root@lenovo-93812 ~]# ps aux | grep mate-menu
aleksee+   49326  5.8  0.5 824756 91060 ?        Sl   11:27   0:00 mate-menu
root       49345  0.0  0.0   6064  2108 pts/2    S+   11:27   0:00 grep --color=auto mate-menu
[root@lenovo-93812 ~]# ps up 49326
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aleksee+   49326  4.0  0.5 824756 91068 ?        Sl   11:27   0:00 mate-menu
[root@lenovo-93812 ~]# dconf update
[root@lenovo-93812 ~]# ps up 49326
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aleksee+   49326 10.5  0.7 912540 119600 ?       Sl   11:27   0:06 mate-menu
[root@lenovo-93812 ~]# dconf update
[root@lenovo-93812 ~]# dconf update
[root@lenovo-93812 ~]# dconf update
[root@lenovo-93812 ~]# ps up 49326
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
aleksee+   49326 33.6  0.9 918580 150544 ?       Sl   11:27   0:36 mate-menu

alxvmr and others added 2 commits November 2, 2024 13:41
When regenerating plugins, the apps plugin was not being released from memory due to un-disconnected connections.

Co-authored-by: Ivan A. Melnikov <[email protected]>
Due to the presence of elements, there were still references to objects in self.tooltipsWidgets. This caused the objects not to be released from memory and caused a memory leak.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants