RAM/SWAP usage
i know its a good thing that my swap is not being used...i have 1GB DDR ram...but i was curious why the swap space is being left untouched when the free ram drops down to even 10MB....im sure my swap space is active...
in a random instance $top Mem: 1033396k total, 840972k used, 192424k free, 93392k buffers Swap: 1574360k total, 0k used, 1574360k free, 496188k cached $free -m total used free shared buffers cached Mem: 1009 764 244 0 91 484 -/+ buffers/cache: 188 820 Swap: 1537 0 1537 any suggestions? and another related questions..is there anyway to purge the used ram?(something like those winblows memory managers like free ram xp pro)....is it even needed? |
-/+ buffers/cache: 188 820
That's almost like 820MB of 'pre-swap' so to speak. 188 is the key number. Something's a little wrong with my system at the moment and I've got: Code:
total used free shared buffers cached As far as purging, seems like there should be, but I can't think of it. sync brings the filesystem data up to date, but I dunno about RAM. But, no, in general, it shouldn't be necessary. Maybe somebody will post up with that. |
Re: RAM/SWAP usage
Quote:
regards |
unless you have a lot of processes and services using all the memory there is NO reason why it will get used.
with 1G ram it's likely you don't don't have a reason to use swap. I remember days when 1G would be the total "disk capacity" on a whole bunch of machines with 10's of users :-)) |
Yeah - I've still got a box with a smaller hard drive than his RAM. :) Huh. As a matter of fact, about half the boxes I've ever owned would fall in that class. :scratch:
|
hey guys
we are getting off the track the problem here is ,how to ensure that the swap too gets used?? regards |
Well, there's no problem. His swap is initialized and he's not maxed on physical memory, so it simply won't get used because it doesn't need to. But if it was needed, I'm sure it would be used. Like I say, it'd only be a concern if swap read zeros all the way across or he *was* maxed out on physical RAM and still wasn't swapping.
|
thanks for the replies:
masand: yes i have compiled thelatest 2.6.10cko kernel, with the con kolivs patch to use 'high memory off(for 1GB machines),and swap is definetly on well the free -m i posted was only a random instance...the point is i have my box running for days..and ive NEVER EVER seen swap being used...even when i had 512 MB DDR ram...thats what worries me... oh and i know that when apps are executed once they get loaded into the memory...so technically my startup of apps should be faster...and they are, but only for a little while...but.. let me illustrate. 1. open firefox (5 seconds) 2. close firefox. 3. open firefox again (1-2 seconds) but, if i do this: 1. open firefox 2. close firefox 3. open Open office 4. open xmms 5. blah blah 6 open firefox again(now its slower than the previous time...i.e more that the ususal 1-2 seconds ) my biggest problems occur when i copy huge files from vfat to reiserfs/4...thats slows everything to a crawl and maxes out ram usage...but swap is never used even then.. thanks again! |
hey can u tell me what options have u enabled in ur kernel that make u sire that u have enabled the swap in ur kernel
coz, i do not use swap inmy system so i have turmed them off!! regards |
Swap use is not a good thing.
100% memory use -is- a good thing. (Because 75% of that is usually just buffers/cache) Using swap slows things down roughly 1000% (yes, that's 4 zeros). There are 4 types of memory: User, Shared, Buffers, and Cache. Buffers and Cache can be considered 'free' memory, they exist only until a 'real' application needs some memory that they occupy, then Linux just re-assigns that memory to that application. These buffers and cache improve the performance of your system, because reading data from physical memory is anywhere from 100-1000 times faster than reading it from disk (swap). Linux stores data in these buffers and cache that it may need again later. (Buffers and cache never hurt you. Having alot of User and Shared memory is what you need to worry about.) But, you have to realize that there is no benefit from storing these in swap, because the data in these buffers and cache is stored on the disk somewhere already. Quote:
Quote:
Swap doesn't get used because that would defeat the purpose. swap is -stored on the disk-. If you are reading from a disk, storing cache from that read on that disk will slow things down, not speed them up. So Linux just doesn't do it. Also, keep this in mind. If you really maxed out your RAM, and swap really -wasn't- working, whatever program you have that's using all that memory, would get an "Out of memory" error and be killed by the kernel. Let Linux do it's job and handle the memory for you. It does an excellent job. And no, the RAM purgers are pointless. They are pointless on Windows too. Most of them are gimmicks to get spyware/adware on your system. -Jeremy |
masand : CONFIG_SWAP=y...and then u have to do a mkswap /dev/hdx ( and swapon /dev/hdx ater that ??)
irwinr: thanks for the detailed reply...guess that sorts out the ram stuff...my speed issues exist AFTER copying large files ..thats the annoying part...is there any workaround for that..? |
Not really. New buffers push old buffers out of memory. So when you copy large files, the new buffer created by the copy command pushes the old cached copied of things like firefox out of memory.
So, it's not really a speed issue. After copying a large file, your programs will start no more slowly than they would if you had just rebooted the computer (Which would clear out the cache). For me, after I do memory intensive tasks (Which kill my cache), my system is just slightly sluggish for a few minutes. But after using all my regular apps for a few minutes, the cache gets built back up and I'm back to multi-tasking like a son of a gun. As far as a workaround.... Not really. I mean, there may be a way to configure the your copy file utility (Which utility are you using, btw? Just the standard 'cp'?) to only use so much memory for buffering. If not, you could write up a quick file copy utility in C and make it use whatever amount of memory you want. But, it won't be as fast. Think about this: If you make it so less data is buffered, you make the whole file transfer take longer. And while the transfer is taking place, your machine is probably -really- slow. Would you rather have your system tied up copying files for a longer amount of time, or would you rather have it get the file transfer done, and be slightly sluggish for 2 or 3 minutes afterward? -Jeremy P.S. What exactly is the nature of these large file transfers? Are you copying data between two different disks in the same system? Or are you copying data between two partitions on the same disk? Or are you copying data across a network? What kind of drives are you using (SCSI, IDE, SATA. Any RAID?) |
this seems fine!!
i remember making a logical drive as my swap partiton and that did nor work making a primary one worked though if u can try that ,give it a try regards |
either drag/drop with kde or just the cp command..anyway my systems behaviour is exactly the same as yours so i guess theres no need to worry..usually my copying is dont across diff filesystems...sometimes across diff disks and filesystems...thanks for all the help..!
|
All times are GMT -5. The time now is 07:14 PM. |