Re: Memory used - but where?
- From: rex.ballard@xxxxxxxxx
- Date: 2 Feb 2006 07:42:33 -0800
Linux tries to make the best use of the available memory as it is
available. It reserves a small amount of heap (the 300 meg you saw)
for Malloc() operations, but the rest is allocated to buffering the
disk drives and hard drives.
If your applications have need for more memory, Linux can flush some of
the cache and make that extra memory available to the applications as
needed.
The main reason for doing this is because the hard drive latency is the
biggest performance killer in a modern PC. The memory and backplane
can handle gigabytes/second, but the hard drive spins at rates between
4500 and 10,000 RPM due to the physics of the spinning drive (heat).
A typical 7200 RPM drive with an 8 Mb internal cache can deliver about
40 megabytes/second - if the operating system can request entire tracks
or cylinders at a time. If the operating system is going out to the
hard drive to flip between directory tracks and multiple application
tracks, and reading only 512 bytes per request, the performance can
really suffer often something as simple as an FTP file transfer can
slow to less than 2 megabytes/second.. By combining the hard drive
cache with the Linux buffer cache, the disk drive access performance
can come much closer to that 20-40 megabyte/second.
There have been attempts to further increase drive throughput, usually
by reading all of the cylinders at once, having multiple heads so that
you can read 2, 3, or even 4 heads and capture entire cylinders or
tracks in a single rotation (many CD and DVD drives still use this
appreach), but to really take advantage of these designs, the
information either needs to be organized and stored in large clusters,
or you need a really large drive cache so that you can pull down 2-8
megabytes in a single spin and throw away what you don't need. Linux
can also improve performance by using it's cache across multiple drives
- typically in a RAID 10 environment where partitions are striped
across multiple drives, and then mirrored. Linux can be used as a SAN
storage system, or it can be used with high performance SAN and NAS
storage systems.
If you need more refined control over your memory allocation, you can
either use virtual machines, or use ulimit to keep an application from
grabbing too much memory. If you need the extra memory, Linux will
provide it to you, but if you are not using it directly, Linux can make
good use of what you aren't using.
It is worth noting that most of the time, when an application is trying
to grab very large amounts of memory, it's usually because the
application is trying to do it's own memory management. In general
this is usually not a really good idea. The problem is that if an
application is caching the drive, then there can be conflicts and
memory thrashing between the drive cache and the application cache.
Some database applications bypass the Linux caching by requesting raw
or uncached partitions.
.
- Prev by Date: Re: Which Linux Distro on IBM Opteron LS20 Blade?
- Next by Date: Re: Linux Multi-CPU performance
- Previous by thread: Which Linux Distro on IBM Opteron LS20 Blade?
- Next by thread: Re: Memory used - but where?
- Index(es):
Relevant Pages
|
|