3 ms·
> If a desktop environment is using a lot > of memory, this means the same memory is > not available to my other apps. No, it doesn't mean that. Your
by avar 4y ago
> If a desktop environment is using a lot
> of memory, this means the same memory is
> not available to my other apps.
No, it doesn't mean that.
Your mental model of a how an OS allocates and manages memory is stuck in the 60s. Nowadays getting a handle on "real" memory use is increasingly illusive.
Probably the best metric is to ignore it altogether, and instead look at memory churn. I.e. how much the OS ends up having to evict some pages from memory to make space for others.
Even that is only meaningful if it's happening on an ongoing basis. I.e. if your DE allocates 1GB that it uses once (or never) having to evict those pages once generally isn't a problem.
It's only a problem once there isn't enough memory to go around for those pages that are in active use.
- kohlerm 4y agoFor a developer doing software builds frequently, the amount of available memory for caching disk access (buffer) can very much make a difference. The more the better.
- senko 4y ago> No, it doesn't mean that. [...] It's only a problem once there isn't enough memory to go around for those pages that are in active use. So it does mean that. The fact that I said it plainly instead of mentioning private dirty pages gobbling up most of the available ram so any executable readonly pages need to be evicted / read all the time, thrashing the system much earlier than the OOM killer can kick in, doesn't mean that "if apps take up lots of memory, other apps have less" statement is untrue.
- avar 4y agoIt's unclear exactly what you mean by the upthread comment, i.e. how "using a lot of memory" maps to e.g. Linux smaps statistics. But you do mention e.g. gnome-shell taking ~2GB. My own gnome-shell has e.g. a 100MB allocation where >95MB is in "Private_Dirty", then a ~200MB allocation where all the columns except "Size" in the "/proc/$(pidof gnome-shell)/smaps" are zero. People typically exclude the latter category when talking about "real" memory use. But the former is the sort of thing that would make it into "real" memory use by most definitions, and show up in "RSS". What I'm pointing out is that knowing that doesn't tell you anything about whether the memory use contributes to memory contention, which is the interesting question. It's entirely possible (and quite common) that most/all of that was used as a one-off, and is either sitting there unused, or would be swapped out as part of expunging stale pages to disk. So, you could have a process that at one point used 2GB of memory, and still hasn't free()'d it, but for the purposes of needing to fit a 7GB browser process into a total of 8GB of RAM won't contribute to contention. Even though it "uses" 2GB still (as in "RSS" etc.) it's only ever accessing 100MB of those 2GB. The kernel will happily page out 1.9GB to swap, and performance will be mostly unaffected. To make any claim about whether an application uses a lot of memory on a modern OS you need to know a lot about its lifetime management of data.
- senko 4y agoFor completness sake, pmap -XX $(pidof gnome-shell) shows 2G in Private_Dirty for me. I have since restarted Zoom so can't measure that.. Naively summing up the Size totals to around 9G. I assume that's the measurement you thought I was referencing. I agree interpreting memory usage numbers on Linux is hard. I also do think modern apps (including here gnome-shell and associated processes) eat up memory like it's unlimited and free.