Re: More RAM for buffers?

2008-10-03 Thread RW
On Thu, 2 Oct 2008 09:58:54 -0500
Kirk Strauser [EMAIL PROTECTED] wrote:

 I have an AMD system with 6GB of RAM.  From dmesg:
 
 usable memory = 6428237824 (6130 MB)
 avail memory  = 6203797504 (5916 MB)
 
 However, most of it is just sitting there when it looks like it could
 be used for buffers or cache:
 
 Mem: 1186M Active, 3902M Inact, 468M Wired, 233M Cache, 214M Buf,
 138M Free Swap: 8192M Total, 900K Used, 8191M Free
 
 Since I've yet to find a great explanation for what the different
 types of memory are, could someone say why all that inactive memory
 is better than using it for cache or buffers?

The terms are a bit misleading, because the don't all relate to the use
of the memory from the user's perspective, but how it's seen within
FreeBSD's integrated cache/VM system.

Active, Inact, Cache and Free are all part of the life-cycle of normal
memory pages, they hold pretty much everything used by  processes,
and disk-caching. Cache actually has little to do with caching as
such; it contains pages that are still holding data, but can be
reused instantaneously because they are consistent with their backing
store.

In not exactly sure what Buf is, but I guess it's low-level disk
buffering memory, that can't be discarded the way normal disk caching
pages can.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-03 Thread Kirk Strauser
On Friday 03 October 2008, RW wrote:

 The terms are a bit misleading, because the don't all relate to the use
 of the memory from the user's perspective, but how it's seen within
 FreeBSD's integrated cache/VM system.

Thanks to you and everyone else who wrote.  I guess I'll go back to using it 
and letting it manage itself.  :-)
-- 
Kirk Strauser
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-03 Thread RW
On Thu, 2 Oct 2008 13:14:35 -0400
Bill Moran [EMAIL PROTECTED] wrote:


 I've never been 100% clear on the exact differences, but it basically
 has to do with where the data in RAM came from.  Depending on whether
 it was a VM page, or a disk page will determine what bucket it goes
 into when it moves out of active.

The distinction is between clean pages (Cache) and dirty pages
(Inactive), a dirty page needs to be written to swap or synced to the
disk, before it can be reused. It's the cache queue that gives the
kernel liquidity, once the free memory is drops below about 2%. It
actively balances the cache and inactive queues to maintain this.

 I'm fairly sure that inactive is memory used by program code.  

Inactive and cached queues are the first step to recycling memory. The
queues don't differentiate between different origins.

 When
 the program terminates, the memory is marked as inactive, which means
 the next time the program starts the code can simply be moved back to
 active and the program need not be reloaded from disk.

I think such pages can remain active. The level of active memory
seems to be mostly a matter of stock-control. When I shutdown
Xorg/KDE, huge amounts of memory remain active for hours. When demand
for memory increases, the queues get rebalanced to provide more
cached/inactive memory. These figures don't really tell you much.

 Buffer and cache memory are disk data held at different points within
 the kernel.  I've never been 100% clear on the difference, and I
 believe it depends heavily on a thorough understanding of how the
 kernel works.
 
 The other rule of thumb I've heard is that the closer memory is to the
 left side of top output, the less expensive it is for the kernel to
 move it to active ... inactive being the most efficient and cache
 requiring the most work by the kernel ... I could be wrong, though.

Partly, but it's more the other way around, the further to the right the
easier it is to reuse (not counting buffer and wired, which are
outside the normal VM/cache system). 

 I know that a lot of what I'm saying isn't authoritative, so I hope
 I'm not remembering any of this wrong.  I think to fully understand
 how it works you'll need to read _The_Design_and_Implementation_.


Matt Dillon's vm-design article is a good place to start. 

http://www.freebsd.org/doc/en_US.ISO8859-1/articles/vm-design/article.html





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


More RAM for buffers?

2008-10-02 Thread Kirk Strauser
I have an AMD system with 6GB of RAM.  From dmesg:

usable memory = 6428237824 (6130 MB)
avail memory  = 6203797504 (5916 MB)

However, most of it is just sitting there when it looks like it could be 
used for buffers or cache:

Mem: 1186M Active, 3902M Inact, 468M Wired, 233M Cache, 214M Buf, 138M Free
Swap: 8192M Total, 900K Used, 8191M Free

Since I've yet to find a great explanation for what the different types of 
memory are, could someone say why all that inactive memory is better than 
using it for cache or buffers?
-- 
Kirk Strauser
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-02 Thread Kirk Strauser
On Thursday 02 October 2008, Kirk Strauser wrote:

 I have an AMD system with 6GB of RAM.  From dmesg:

 usable memory = 6428237824 (6130 MB)
 avail memory  = 6203797504 (5916 MB)

 However, most of it is just sitting there when it looks like it could be
 used for buffers or cache:

On another AMD64 machine, also with 6GB of RAM, I have:

Mem: 482M Active, 1044M Inact, 363M Wired, 3792K Cache, 214M Buf, 4023M Free
Swap: 8192M Total, 8192M Free

I can understand that on the other machine maybe inactive memory is more 
beneficial than cache or buffers, but this system is just sitting there 
with 4GB free (and the exact same amount of buffer memory as on the other, 
which seems a little too coincidental).
-- 
Kirk Strauser
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-02 Thread Wojciech Puchar


   usable memory = 6428237824 (6130 MB)
   avail memory  = 6203797504 (5916 MB)

However, most of it is just sitting there when it looks like it could be
used for buffers or cache:

Mem: 1186M Active, 3902M Inact, 468M Wired, 233M Cache, 214M Buf, 138M Free
Swap: 8192M Total, 900K Used, 8191M Free


i don't really know what it's actually are but inact are disk caches 
often.


your files are cached
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-02 Thread Wojciech Puchar

Mem: 482M Active, 1044M Inact, 363M Wired, 3792K Cache, 214M Buf, 4023M Free
Swap: 8192M Total, 8192M Free

I can understand that on the other machine maybe inactive memory is more
beneficial than cache or buffers, but this system is just sitting there
with 4GB free (and the exact same amount of buffer memory as on the other,
which seems a little too coincidental).
--

just more files was not read already :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-02 Thread Bill Moran
In response to Kirk Strauser [EMAIL PROTECTED]:

 On Thursday 02 October 2008, Kirk Strauser wrote:
 
  I have an AMD system with 6GB of RAM.  From dmesg:
 
  usable memory = 6428237824 (6130 MB)
  avail memory  = 6203797504 (5916 MB)
 
  However, most of it is just sitting there when it looks like it could be
  used for buffers or cache:
 
 On another AMD64 machine, also with 6GB of RAM, I have:
 
 Mem: 482M Active, 1044M Inact, 363M Wired, 3792K Cache, 214M Buf, 4023M Free
 Swap: 8192M Total, 8192M Free
 
 I can understand that on the other machine maybe inactive memory is more 
 beneficial than cache or buffers, but this system is just sitting there 
 with 4GB free (and the exact same amount of buffer memory as on the other, 
 which seems a little too coincidental).

inactive, cache, and buffer are all different types of buffer.

I've never been 100% clear on the exact differences, but it basically has
to do with where the data in RAM came from.  Depending on whether it was
a VM page, or a disk page will determine what bucket it goes into when
it moves out of active.

I'm fairly sure that inactive is memory used by program code.  When the
program terminates, the memory is marked as inactive, which means the
next time the program starts the code can simply be moved back to
active and the program need not be reloaded from disk.

Buffer and cache memory are disk data held at different points within the
kernel.  I've never been 100% clear on the difference, and I believe it
depends heavily on a thorough understanding of how the kernel works.

The other rule of thumb I've heard is that the closer memory is to the
left side of top output, the less expensive it is for the kernel to move
it to active ... inactive being the most efficient and cache requiring
the most work by the kernel ... I could be wrong, though.

I know that a lot of what I'm saying isn't authoritative, so I hope I'm
not remembering any of this wrong.  I think to fully understand how it
works you'll need to read _The_Design_and_Implementation_.

-- 
Bill Moran
http://www.potentialtech.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-02 Thread Josh Carroll
 inactive, cache, and buffer are all different types of buffer.

That is my understanding as well.

 I'm fairly sure that inactive is memory used by program code.  When the
 program terminates, the memory is marked as inactive, which means the
 next time the program starts the code can simply be moved back to
 active and the program need not be reloaded from disk.

I think non-program code can also be inactive.

For example, top memory output before:

Mem: 337M Active, 1455M Inact, 407M Wired, 352K Cache, 214M Buf, 1745M Free

and after:  find /usr/src -type f -print0 | xargs -0 cat  /dev/null 21

Mem: 348M Active, 1905M Inact, 402M Wired, 912K Cache, 214M Buf, 1288M Free

I am also not sure exactly what constitutes each of these. I only know
what the top man page says. And for Buf it says:

   Buf:   number of pages used for BIO-level disk caching

I'm not entirely sure what BIO-level disk caching is, but it is
apparently NOT the caching of filesystem data.

Josh
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: More RAM for buffers?

2008-10-02 Thread Wojciech Puchar

active and the program need not be reloaded from disk.


I think non-program code can also be inactive.


i am sure.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]