NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: top says much memory for File, less for Free




On 26-Feb-08, at 10:53 AM, Water NB wrote:

I have 2G memory, after run few days, top says:
Memory: 1353M Act, 68k Inact, 2000K Wired, 25M Exec, 1243M File, 45M
free

I want to know,
1) How 2G is used?

Try watching what "systat vm" and "systat bufcache" have to say

2G = who? + who? + who?
2) Why so much used for File, so less for Free?

because you've accessed lots of files in the time since boot and there's not been so much other pressure for other types of memory uses, and of course because the current VM parameters have allowed such use.

In any case don't assume that using memory for file buffers is bad -- it's usually not.

how can I reduce File used?

The first question to ask yourself is why you would want to do so.

Are you absolutely 101% certain that you know better than the kernel how it should be making use of the available RAM in your system?

In any case you might want to add something like the following to your /etc/sysctl.conf file and then adjust for your system's needs:

# the rest are VM pager tuning parameters
#
# Questions:  Does the pager eventually always free inactive pages
# above the vm.*max limits?  Is this worse for exec and file pages
# than it is for anon pages?  Does it even matter if inactive anon
# pages are preserved for very long?
#
# See http://www.selonen.org/arto/netbsd/vm_tune.html
# and of course http://www.ccrc.wustl.edu/pub/chuck/psgz/diss.ps.gz

# the minimum percentage of memory always (made) available for anonymous pages
#
# The default is 10, which is way too low...
#
vm.anonmin=40

# the maximum percentage of memory that will be reclaimed from others for anonymous pages
#
# The default is 80, which seems just about right, but then again it's
# unlikely that the majority of inactive anonymous pages will ever be
# reactivated so maybe this should be lowered?
#
vm.anonmax=80

# the minimum percentage of memory always (made) available for text pages
#
# The default is 5, which is way too low...
#
vm.execmin=25

# the maximum percentage of memory that will be reclaimed from others for text pages
#
# The default is 30, which seems way too low, esp. for big programs...
#
vm.execmax=50

# the minimum percentage of memory always (made) available for the file data cache
#
# The default is 10, which is much too high, even for a large-memory
# system...
#
vm.filemin=5

# the maximum percentage of memory that will be reclaimed from others for file data cache
#
# The default is 50, which may be too high for small-memory systems
# but may be about right for large-memory systems...
#
#vm.filemax=25


--
                                        Greg A. Woods; Planix, Inc.
                                        <woods%planix.ca@localhost>





Home | Main Index | Thread Index | Old Index