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

Plug the memory leak #128

Merged
merged 6 commits into from
Dec 22, 2023
Merged

Plug the memory leak #128

merged 6 commits into from
Dec 22, 2023

Conversation

nokyan
Copy link
Owner

@nokyan nokyan commented Dec 19, 2023

Resources has been suffering from a nasty memory leak for a while now, right now we've at least located where it happens.

It happens during resorting the process and application list after a refresh, especially when many items have changed their position in the list (which happens e. g. when sorting after CPU usage rather than memory usage).
In commit 8d69995, the culprit lines are at src/ui/pages/processes/mod.rs:484 and src/ui/pages/applications/mod.rs:508.

Unfortunately, I don't know how to fix it yet, I hope I'll be able to fix it with release 1.3.

Update #‎​1 (2023-12-21): I may have fixed the original memory leak on accident before but introduced another one with right-click context menus. I've removed them again for now and during my testing, this fixed it and memory usage is under control

@nokyan nokyan mentioned this pull request Dec 19, 2023
@nokyan
Copy link
Owner Author

nokyan commented Dec 22, 2023

So in my recent testing, there is still a leak but it's definitely gone down by quite a lot. I let this Resources branch run overnight for about 15 hours on very fast UI refresh speed in the processes view and with sorting set to CPU usage during which memory usage rose up to about 600 MB from the starting point of about 90 MB. Current Resources 1.2.1 rose within about 11 hours to over 3 GB with the same settings.

@nokyan nokyan marked this pull request as ready for review December 22, 2023 15:00
@nokyan nokyan merged commit c45f443 into main Dec 22, 2023
@nokyan nokyan deleted the memory-leak-fix branch December 23, 2023 15:25
aeghn pushed a commit to aeghn/restop that referenced this pull request Oct 29, 2024
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.

1 participant