35 ms·
To answer your Chrome question, it’s open source and the tab discarding code is pretty straightforward. GetSortedLifecycleUnits sorts using GetSortKey, which f
by hinoki 4y ago
To 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.