Example 11.4 ulimit: Settings in ~/.bashrc
# Limits maximum resident set size (physical memory):
ulimit -m 98304
# Limits of virtual memory:
ulimit -v 98304
Memory allocations must be specified in KB. For more detailed information, see man
bash.
IMPORTANT
Not all shells support ulimit directives. PAM (for instance, pam_limits)
offers comprehensive adjustment possibilities if you depend on encompassing
settings for these restrictions.
11.1.6 The free Command
The free command is somewhat misleading if your goal is to find out how much
RAM is currently being used. That information can be found in /proc/meminfo.
These days, users with access to a modern operating systems, such as Linux, should
not really need to worry much about memory. The concept of available RAM dates
back to before the days of unified memory management. The slogan free memory is
bad memory applies well to Linux. As a result, Linux has always made the effort to
balance out caches without actually allowing free or unused memory.
Basically, the kernel does not have direct knowledge of any applications or user data.
Instead, it manages applications and user data in a page cache. If memory runs short,
parts of it are written to the swap partition or to files, from which they can initially be
read with the help of the mmap command (see man mmap).
The kernel also contains other caches, such as the slab cache, where the caches used
for network access are stored. This may explain the differences between the counters
in /proc/meminfo. Most, but not all, of them can be accessed via /proc/
slabinfo.
118
Administration Guide
Need help?
Do you have a question about the LINUX ENTERPRISE DESKTOP 11 - ADMINISTRATION GUIDE 17-03-2009 and is the answer not in the manual?