Memory, Swap Management

为当前最终发行版之前的所有版本提供支持
回复
头像
jazzi
帖子: 532
注册时间: 2005-10-16 23:26
来自: 泉州
送出感谢: 0
接收感谢: 3 次
联系:

Memory, Swap Management

#1

帖子 jazzi » 2005-12-18 13:30

A lot of Linux newbies, myself included are often astonished at the amount (%) of memory used by Linux as opposed to, say, Windows on comparable systems. If you look at the System Monitor (Applications -> System Tools -> System Monitor), you can find the amount of memory used by your system. If you leave your computer on for a long period (say more than a day) then the memory usage seems to keep going up. This is a “good thing”. Let me explain why.

Linux actively uses free available memory to improve your system’s performance. Let’s say you have 1 GB of main memory (don’t we all wish!). Now, suppose all the programs you are running together require only 200 MB of memory. What happens to the other 800 MB of the available memory?

On a linux system, the memory is used to “cache” data that is used by the CPU. The idea behind caching is that it takes longer for your CPU to access data on the hard drive than it does to access data that is present in the main memory. So caching using the main memory effectively speeds up the system. On a windows system, there is no such optimization, so free memory is wasted as it does not get used.

Now when an application really needs all the memory that is used for caching, Linux pops out the cached data and makes the required memory available. As a last option, if all of the main memory is used up, then the memory you set aside in your swap partition is used too.

Try the command:
$free -m

to see what your memory usage is. The first line of results is fairly obvious. The second line tells you what the applications “see”, and should tell you how much memory is actually being used by the applications themselves.

Another used command is “top” which gives you a look at the memory/cpu usage and other details about the processes that are running on your computer - all at the terminal. I much prefer it to the GUI-based System Monitor myself.

Knowing that all the memory I paid for is being used to the max makes me feel all warm and fuzzy. For a moment earlier today, I thought there was something wrong, since almost all of my memory was being used, and I was hardly running anything intensive - now I am at ease - there was something wrong earlier, when the memory was not being used by Windows - now I know!!

文章来源于http://ubuntu.wordpress.com/tag/commands/
You make it fun
It will make you fun
ddlov
帖子: 19
注册时间: 2005-11-18 13:37
送出感谢: 0
接收感谢: 0

#2

帖子 ddlov » 2005-12-18 15:31

翻译?
头像
jazzi
帖子: 532
注册时间: 2005-10-16 23:26
来自: 泉州
送出感谢: 0
接收感谢: 3 次
联系:

#3

帖子 jazzi » 2005-12-20 13:41

总的意思就是说,在linux中内存如果所剩无几了,说明你用银子买的内存被充分利用了,而不是闲置,而在windows中就是浪费了,因为你买了东西没有用。
而且充分利用内存可以加速系统的速度,因为数据存在内存中肯定比存在硬盘上反应快
You make it fun
It will make you fun
duoxing
帖子: 122
注册时间: 2005-12-20 21:26
来自: UESTC
送出感谢: 0
接收感谢: 0
联系:

#4

帖子 duoxing » 2005-12-21 14:21

这个是linux的一个特点,对提升机器的性能有很大的好处,同时linux的内存管理模式也和windows有很大的不同,这个可能会给刚转到linux的朋友一点疑惑。
commus
帖子: 19
注册时间: 2005-12-17 2:24
送出感谢: 0
接收感谢: 0
联系:

#5

帖子 commus » 2006-01-27 21:03

我的英文很poor
我现在只能把SWAP认为是WIN下的虚拟缓存,其实好象不是这样理解的
LINUX有个好处就是在程序运行是掉用库的时候调用后,如果其他程序也用这个库就可以共享使用,好象WIN必须得再次调用。这也是LINUX一个好处吧
OS:UBUNTU Version6.10+WindowsXP sp1
CPU:Intel Celeron D 320 2.4G
MAINBOARD:ASUS P4P800S-X
RAM:V-DATA 256MDDR400*2
HD:Seagate 7200rpm 8M 80G+Maxtor 5400rpm 2M 20G
DISPLAY CARD:ATI Radeon9550
回复

回到 “老旧版本支持”