Inactive Memory vs. Free Memory

We have a couple of boxes running; top perpetually looks like this:

Code:
last pid: 66910;  load averages:  0.02,  0.11,  0.07   up 17+13:35:30  10:21:28
80 processes:  2 running, 78 sleeping
CPU:  1.6% user,  0.0% nice,  3.1% system,  3.5% interrupt, 91.8% idle
Mem: 62M Active, 2813M Inact, 223M Wired, 151M Cache, 112M Buf, 4668K Free
Swap: 28G Total, 92K Used, 28G Free

Roughly ~80 -> ~100 processes, low load average, but only 4668K of Free Mem. Is this normal? My understanding is that Inact memory is basically the same as free memory.... so why doesn't FBSD clear that out? If a proc needed say, 10GB of memory at this point, does it ask the system to clear some Inact memory and then wait for that to be done?
 
Free memory is wasted memory -- an old BSD Unix saying.

So yes, with an uptime of 17.5 days, 4MBs of free memory is quite normal.

Free memory is memory that has *never* been used.
In inactive memory you may have clean or dirty pages. Dirty pages are no longer in use, may be removed in the near future (after being synced to disk) and reallocated for something else.
 
A lot.
It uses a lot of memory for caching (that can be freed at any time)

I remember when I was using UFS I had about 45MB free after some time of using PC.

Now with zfs it's a different story. Most of time I have about 1.5G
This doesn't mean that UFS was memory hungry, in fact, it's zfs that's memory hungry, they just work differently.

I think it's also like this because of UFS_DIRHASH enabled in kernel :)
But that is my guess.
Well this is all i know
 
You'll probably find that at least some of that inactive memory has already been mirrored in swap, so that it is immediately available if a large request is made.

You can be sure that the kernel is in a great position to free up heaps of memory very fast if a program requests it. Here's an exercise: Set up a fork bomb and see how quickly it grows!
 
Thank you all very much. Now I understand the distribution of memory. Just I at busy memory 30G tried to write down there in memory disk 10G the file and received the hung system. Therefore, I thought that FreeBSD rests on some kind of restriction.
 
Back
Top