[mdlug] Avail

Adam Tauno Williams awilliam at whitemice.org
Thu Sep 26 15:34:33 EDT 2013


On Thu, 2013-09-26 at 12:03 -0400, Garry Stahl wrote:
> On the old Amiga CLI there is a command "avail" that told you how much 
> memory you where using.
> Now it also had a switch "flush" that freed up any memory registers that 
> had been allocated that were no longer in use
> Does the Linux CLI have a similar command?

"free -t"

Note however that the meaning of these numbers is emphatically *not*
self-evident.  Memory management on modern OSs is leaps-and-bounds more
complication, clever, and convoluted than in days of yore.

(a) the system does not bother to release allocated memory no longer
used unless there is actually memory pressure.  why?  that just takes
cycles from doing useful stuff.
(b) there are numerous levels of cache and buffering.
(c) read-only pages can be allocated to multiple processes, this greatly
increases efficiency as well as frequently freaking people out that some
app is using jigabytes of memory [yes, it is, but no, it is not, chill].
(d) do not ever believe anything about memory management that you read
on StackOverflow.

FYI, you can "echo 3 >/proc/sys/vm/drop_caches" to have the kernel
release most of the information it is caching.  This is useful for when
performing benchmarks of I/O subsystems, otherwise you are measure the
performance of the cache and not the subsystem. 

This article is pretty good
<http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory>



-- 
Adam Tauno Williams <mailto:awilliam at whitemice.org> GPG D95ED383
Systems Administrator, Python Developer, LPI / NCLA



More information about the mdlug mailing list