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/
Memory, Swap Management
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
- jazzi
- 帖子: 532
- 注册时间: 2005-10-16 23:26
- 来自: 泉州
- 联系:
Memory, Swap Management
You make it fun
It will make you fun
It will make you fun
- jazzi
- 帖子: 532
- 注册时间: 2005-10-16 23:26
- 来自: 泉州
- 联系:
-
- 帖子: 122
- 注册时间: 2005-12-20 21:26
-
- 帖子: 19
- 注册时间: 2005-12-17 2:24
我的英文很poor
我现在只能把SWAP认为是WIN下的虚拟缓存,其实好象不是这样理解的
LINUX有个好处就是在程序运行是掉用库的时候调用后,如果其他程序也用这个库就可以共享使用,好象WIN必须得再次调用。这也是LINUX一个好处吧
我现在只能把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
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