3 ms·
I find swap and memory usage in general confusing. On my Windows machine, Chrome is listed as using about 1GB of RAM and I have maybe 50 tabs open. Seems like a
by jbritton 4y ago
I find swap and memory usage in general confusing. On my Windows machine, Chrome is listed as using about 1GB of RAM and I have maybe 50 tabs open. Seems like a lot. I think it’s possible that Chrome creates 50 processes and that the memory of DLLs loaded get over counted 50x. So 20MB of actual RAM DLL usage could be listed as 1GB. However maybe the DLLs are say 10MB and then Chrome would be using 500MB of data of 500MB of code. This might help with switching tabs and instantly seeing a page. For me though none of the tabs data need caching. I would prefer they just reload when needed. So I have this confusion. How much RAM is Chrome using? How much is truly needed vs hopefully fortuitous caching. Can some data be marked more important or is it all just LRU? Should Chrome free all memory on non-visible tabs?
How do I know how much RAM to buy when I don’t know what anything really needs.
Process Manager shows 8GB used of 16GB, but I currently have very little running. Chrome, Outlook, Ring Central. How would one know if this could run with 4GB or 8GB? Do you just have to try it and see if it seems sluggish.
How does one distinguish memory used by code vs data?
- hinoki 4y agoTo answer your Chrome question, it’s open source and the tab discarding code is pretty straightforward. GetSortedLifecycleUnits sorts using GetSortKey, which for tabs is their last used time. So it’s just LRU. But some comments hint that maybe something smarter will happen eventually. As for your overall question, there are no easy answers. Deciding if memory is being used well, or could be repurposed to do something more useful is a difficult question to answer. https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/resource_coordinator/tab_manager.cc;l=393?q=DiscardTabImpl&ss=chromium https://source.chromium.org/chromium/chromium/src/+/main:chr... Edit: also, it’s really hard to reason about how much memory you need unless it’s very well defined (you know the size of data, exactly what processes to run), once you get to desktop operating systems, it’s more run and find out than reasoning from first principals. Disclosure: I work on ChromeOS.
- 0xdeadb00f 4y ago1GB for 50 tabs seems reasonable to me considering for me it sucks around the same amount of memory for like 15-20 tabs.