Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One has to be careful when looking at memory usage to judge these kinds of things, though. Linux has a tendency to use memory unused by applications for its own purposes, because it's not being used anyway and it might as well do something useful with it.

Oftentimes this ends up being something like aggressively caching file data so that it doesn't have to write to disk very often. While this does get labeled as "used" memory, it can very quickly be freed up by the operating system by evicting this cached data back to disk if that memory is needed elsewhere.

This can make Linux appear more memory-hungry, but in actuality a better description might be that Linux is more effectively using the resources at its disposal. I'm not saying that this is what's happening in this case, but it's a possibility.



Agreed. Compare that with http://www.linuxatemyram.com/


The main thing that matters is when I execute a command it runs fast. and OS is fast... As far as I am concerned os could be sending all my free memory to /dev/null. As long as performance and stability stay up; it can do whatever it wants...


You think Linux is alone in acting like that?


No, but maybe others don't report such memory as used, which seems unfortunate to me.


FreeBSD has many labels for how it uses memory. Active, Inactive, Cache etc, to specify the purpose. See this question and answer: http://unix.stackexchange.com/questions/134862/what-do-the-d...


They're less labels for purpose and more labels for lifecycle - data you'd consider "cached" can appear just about anywhere. From what I remember (corrections more than welcome):

Active is fully-fledged in use memory, mapped into one or more processes

Inactive is where Active goes when it's less in-use. Cheap to reactivate, but relatively costly to free: can still be mapped into processes, and may be dirty (modified) and thus require writing to disk before being unmapped and cleared for reuse.

Cached is where lesser used Inactive cached data goes before it dies. More costly to reactivate, but cheap to free: No longer mapped directly into any process, and strictly consists of only clean (unmodified) pages that don't need writing back to disk before clearing.

Wired is pinned-down memory that can't be swapped out. ZFS's data and metadata caches are counted here, since it maintains its own (known as the ARC - Adaptive Replacement Cache, after the algorithm it's based on) instead of just relying on the traditional VM page cache.


At least Windows Servers do. Administrators are often confused about why all memory is being used, when it's used by disk cache. (memory mapped files)


You can use 'free -m' to view the actual amount of memory being used.


Or:

    free -h
h for human, so it converts to KiB, MiB or GiB depending on which one is the most suitable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: