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

High Idle Memory Usage #407

Open
winrid opened this issue Mar 8, 2023 · 11 comments
Open

High Idle Memory Usage #407

winrid opened this issue Mar 8, 2023 · 11 comments

Comments

@winrid
Copy link

winrid commented Mar 8, 2023

Is there something we can do to reduce the memory usage of the background daemon? I actually restart my system fairly often (several times a week) to switch to/from Win10 and right now io.elementary.appcenter is using 760mb of ram in the background. This is a fresh install of latest PopOS.

It's not using any CPU... just seems like excessive memory for something that has to check for updates :) People complain about slack's memory usage - but this is using more than Slack and I don't even have it open. :)

@winrid
Copy link
Author

winrid commented Mar 8, 2023

It looks like maybe package metadata is kept in memory? Maybe we can use sqlite to store that? With indexes on package id/name things will still be fast, and memory usage will be minimal.

@yetimaan
Copy link

Jumping in here. I believe this issue has been asked and answered many times. Yes, I can validate the memory consumption does climb from 1MB - 20MB per "Check for Updates" request.

I can also validate closing the pop_shop removes the app from memory and the OS reclaims the RAM.

@winrid
Copy link
Author

winrid commented Apr 21, 2023

Hey @yetimaan!

Just because I was curious, I checked app center and it's using 793mb of ram right now.

I restart my computer about every day since I switch to Windows often, and I have not opened pop shop in some time.

Does it check for updates 30+ times a day?

@yetimaan
Copy link

Hey @winrid !

Does it check for updates 30+ times a day?

I just checked the source code. I'm not a Vala dev, but it seems that the daemon is definitely checking updates at some point. Either on first launch or throughout the day - I"m not sure.

Pop_OS devs are absolutely working on this issue though. Look at the Pull Requests. There's one with upstream updates that seem to address this problem.

I'd wait for a little bit until the team finishes their quality assurance process!

@yetimaan
Copy link

@winrid Yes, mine does ramp up RAM usage when idle. It's used about 10MB more over two hours.

@reuvenpo
Copy link

Hi!

I'm coming in 8 months later, just installed pop_os this week, and i usually keep my machine alive for months without restarts. I noticed that it's taking up 1.2GBs after only 2 days which is really significant.
Is there any progress on this issue?

Thanks :)

@jacobgkau
Copy link
Member

@reuvenpo If there is progress on an issue, you'll see it noted on the issue page. No need to ask.

@winrid
Copy link
Author

winrid commented Dec 21, 2023

@jacobgkau I think checking in after this period of time is perfectly acceptable... considering the referenced PR was closed: #401

Correct me if I'm wrong but it also doesn't appear anyone is addressing the core issue - that it seems the shop stores all the information in memory and uses the UI event loop to search. This could all be solved by storing the shop data in sqlite or similar.

@jacobgkau
Copy link
Member

considering the referenced PR was closed: #401

That PR was replaced by #416 (it's linked on the page of #401 if you read through it), which has been merged already and did bring some performance and resource usage improvements.

Correct me if I'm wrong but it also doesn't appear anyone is addressing the core issue - that it seems the shop stores all the information in memory and uses the UI event loop to search. This could all be solved by storing the shop data in sqlite or similar.

The Pop!_Shop is currently based on Elementary AppCenter: https://github.com/elementary/appcenter I don't think making large architectural changes downstream would necessarily be the best route to go, but you're welcome to propose changes upstream if they'd make sense there, or to take a crack at replacing the search functionality with something else in Pop!_OS.

System76's development effort is currently on the COSMIC Epoch desktop environment, as our blog posts and other public communications have been detailing for some time. Truth be told, we'd be open to replacing the AppCenter-based Pop!_Shop with something else eventually, but it just hasn't been high enough on the list to commit resources to yet.

@jacobgkau
Copy link
Member

To clarify one other point brought up earlier in this issue page:

Does it check for updates 30+ times a day?

The daily/weekly/monthly update checking (whatever you've set the option to in the Settings app) is performed by the system-updater service (com.system76.SystemUpdater.service), not the Pop!_Shop. I believe the only reason the Pop!_Shop currently runs in the background is to provide the search service for the Applications menu.

Aside from that, the shop checks for updates on launch and when you manually refresh it.

@winrid
Copy link
Author

winrid commented Dec 21, 2023

Thanks for the context. Maybe I'll take a crack at fixing it upstream. But won't the rewrite in rust include an app center at some point?

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

No branches or pull requests

4 participants