This is a discussion on How to free the memory? within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hello everyone, I have one server with 2 exon 2.4G Hz and 3G memory, but after one long time, ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello everyone, I have one server with 2 exon 2.4G Hz and 3G memory, but after one long time, I find almost all the physical memory is used and only 15M is free, so that my server is very slow. I know these used memory is not used always but not cleared after use, How should I free the used physical memory? Have a good day! B.R. Joffre |
| |||
| "tech11" (tech11@sohu.com) writes: > Hello everyone, > > I have one server with 2 exon 2.4G Hz and 3G memory, but after one long > time, I find almost all the physical memory is used and only 15M is free, so > that my server is very slow. I know these used memory is not used always but > not cleared after use, How should I free the used physical memory? > Are you sure you're reading the free output properly? Linux uses up as much RAM as it can, to buffer and cache things. If it runs out of RAM, then it starts using swap space. But if it's just buffers and cache that memory is still available. You want to check and see if swap is being used much. If it's a relatively small amount, either swap is not being used properly (at some point I was seeing 0 swap being used, and it turned out I'd forgotten to initialize something), or likely lack of memory is not a problem. This is what I get when I use free: total used free shared buffers cached Mem: 255936 246556 9380 0 25916 110732 -/+ buffers/cache: 109908 146028 Swap: 498004 36828 461176 That first line, the used column makes it look like pretty much all the ram is being used, but the buffers and cached use up much of it, as shown by their columns. The second line shows how much is really being used, 109megs, with over half of my RAM still available. The third line shows that I am barely using swap. Michael |
| |||
| tech11 wrote: > Hello everyone, > > I have one server with 2 exon 2.4G Hz and 3G memory, but after one long > time, I find almost all the physical memory is used and only 15M is free, so > that my server is very slow. I know these used memory is not used always but > not cleared after use, How should I free the used physical memory? I have never run a server. I am strictly a home user. However nothing looks wrong with that free memory. What is the swap space usage? A slow anything is a problem. It will slow when using swap space but only when you do something new rather than repeating something old already in RAM. However I have seen this slowing with ill-behaved applications so what are you running besides server apps? And also when the swap was too large for the RAM. So you do have 6 gigs and no more of swap, right? More is not better. Server apps should be well-behaved as server guys love the number of 9s in their availabilty brag and thus hate reboots. You say after a long time so even if it is only a tic-tac-toe game you play if it is ill-behaved it can add up. Ill-behavior here would be locking and not releasing memory so huge chunks have to be swapped. You could search for apps that are unneeded and kill them and see if things improve. php modules and similar modules are not guaranteed to be well-behaved and likely are not until they are legacy from the last major revision. -- America did not learn from a one day strike by illegals. The only way to teach America a real lesson is to go back to Mexico until America begs you to return. -- The Iron Webmaster, 3644 nizkor http://www.giwersworld.org/nizkook/nizkook.phtml environmentalism http://www.giwersworld.org/environment/aehb.phtml a9 |
| |||
| "Michael Black" <et472@FreeNet.Carleton.CA> 写入消息新闻:e8crhj$qnk$1@theodyn.ncf.ca... > "tech11" (tech11@sohu.com) writes: >> Hello everyone, >> >> I have one server with 2 exon 2.4G Hz and 3G memory, but after one long >> time, I find almost all the physical memory is used and only 15M is free, >> so >> that my server is very slow. I know these used memory is not used always >> but >> not cleared after use, How should I free the used physical memory? >> > Are you sure you're reading the free output properly? > > Linux uses up as much RAM as it can, to buffer and cache things. If it > runs out of RAM, then it starts using swap space. But if it's just > buffers > and cache that memory is still available. > > You want to check and see if swap is being used much. If it's a > relatively > small amount, either swap is not being used properly (at some point I > was seeing 0 swap being used, and it turned out I'd forgotten to > initialize > something), or likely lack of memory is not a problem. > > This is what I get when I use free: > > total used free shared buffers cached > Mem: 255936 246556 9380 0 25916 110732 > -/+ buffers/cache: 109908 146028 > Swap: 498004 36828 461176 > > That first line, the used column makes it look like pretty much all > the ram is being used, but the buffers and cached use up much of it, > as shown by their columns. > > The second line shows how much is really being used, 109megs, with over > half of my RAM still available. > > The third line shows that I am barely using swap. > > Michael > Thanks you very much! My used swap is 0 and used buffers is 411716, but my server is really slow. Normally after one new reset, it'll run fast. Have a good day! B.R. Joffre |
| |||
| tech11 wrote: > "Michael Black" <et472@FreeNet.Carleton.CA> 写入消息新闻:e8crhj$qnk$1@theodyn.ncf.ca... >> "tech11" (tech11@sohu.com) writes: >>> Hello everyone, >>> >>> I have one server with 2 exon 2.4G Hz and 3G memory, but after one long >>> time, I find almost all the physical memory is used and only 15M is free, >>> so >>> that my server is very slow. I know these used memory is not used always >>> but >>> not cleared after use, How should I free the used physical memory? >>> >> Are you sure you're reading the free output properly? >> >> Linux uses up as much RAM as it can, to buffer and cache things. If it >> runs out of RAM, then it starts using swap space. But if it's just >> buffers >> and cache that memory is still available. >> >> You want to check and see if swap is being used much. If it's a >> relatively >> small amount, either swap is not being used properly (at some point I >> was seeing 0 swap being used, and it turned out I'd forgotten to >> initialize >> something), or likely lack of memory is not a problem. >> >> This is what I get when I use free: >> >> total used free shared buffers cached >> Mem: 255936 246556 9380 0 25916 110732 >> -/+ buffers/cache: 109908 146028 >> Swap: 498004 36828 461176 >> >> That first line, the used column makes it look like pretty much all >> the ram is being used, but the buffers and cached use up much of it, >> as shown by their columns. >> >> The second line shows how much is really being used, 109megs, with over >> half of my RAM still available. >> >> The third line shows that I am barely using swap. >> >> Michael >> > > Thanks you very much! > > My used swap is 0 and used buffers is 411716, but my server is really slow. > Normally after one new reset, it'll run fast. > Machines can be slow for reasons other than lack of RAM. You may be running processes with small memory requirements that hog other resources, such as raw processing power, inadequate cache memory on the processor chip(s), inadequate memory speed, inadequate IO speed, etc. You might find it helpful to run xosview or top, or both, and see what is actually happening. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jersey http://counter.li.org ^^-^^ 07:30:01 up 84 days, 21:02, 5 users, load average: 4.45, 4.33, 4.28 |
| ||||
| "tech11" <tech11@sohu.com> wrote in news:e8d9qk$eol$1@news.cn99.com: > > "Michael Black" <et472@FreeNet.Carleton.CA> > 写入消息新闻:e8crhj$qnk$1@theodyn.ncf.ca... >> "tech11" (tech11@sohu.com) writes: >>> Hello everyone, >>> >>> I have one server with 2 exon 2.4G Hz and 3G memory, but after one >>> long time, I find almost all the physical memory is used and only >>> 15M is free, so >>> that my server is very slow. I know these used memory is not used >>> always but >>> not cleared after use, How should I free the used physical memory? >>> >> Are you sure you're reading the free output properly? >> >> Linux uses up as much RAM as it can, to buffer and cache things. If >> it runs out of RAM, then it starts using swap space. But if it's >> just buffers >> and cache that memory is still available. >> >> You want to check and see if swap is being used much. If it's a >> relatively >> small amount, either swap is not being used properly (at some point I >> was seeing 0 swap being used, and it turned out I'd forgotten to >> initialize >> something), or likely lack of memory is not a problem. >> >> This is what I get when I use free: >> >> total used free shared buffers >> cached >> Mem: 255936 246556 9380 0 25916 >> 110732 -/+ buffers/cache: 109908 146028 >> Swap: 498004 36828 461176 >> >> That first line, the used column makes it look like pretty much all >> the ram is being used, but the buffers and cached use up much of it, >> as shown by their columns. >> >> The second line shows how much is really being used, 109megs, with >> over half of my RAM still available. >> >> The third line shows that I am barely using swap. >> >> Michael >> > > Thanks you very much! > > My used swap is 0 and used buffers is 411716, but my server is really > slow. Normally after one new reset, it'll run fast. > > Have a good day! > > B.R. > Joffre > > > You might try top and sort by cPu usage to see what's grabbing all the cycles, but it could also be a memory leak in some app too I suppose. The list of hardware on/in the machine might help as well. -- (setq (chuck nil) car(chuck) ) |
| Thread Tools | |
| Display Modes | |
|
|