it's a common question for linux users
check the smoothwall pages ....
linux will cache your hard drive accesses, so it uses memory, but more cache/swap rather than in memory
Right after boot my linux sys takes only 16mb of ram. After some compiling, say the kernel, it takes 110mb of ram, which is a lot in my 128mb-laptop.
Only the same processes that started on boot are still running. Waiting 10min didn't help at all...
Why doesn't the kernel free the unused memory? Or if it does, why does it do it so slowly and how could I improve it?
it's a common question for linux users
check the smoothwall pages ....
linux will cache your hard drive accesses, so it uses memory, but more cache/swap rather than in memory
Linux will cache memory to speed up application performance that may wish to reuse the memory. It is a good thing.
>>
Why doesn't the kernel free the unused memory? Or if it does, why does it do it so slowly and how could I improve it
>>
It will free it when/if it's needed.
You don't mention the kernel, iirc 2.6.8 or .9 vanilla did have problems with memory/swap usage. But it was fixed in the following version.
jm
With only 128MB of RAM to play with I would consider making and using either a swap partition or swap file. As a general rule of thumb I've been informed that a swap partition should be no more than twice the physical memory size wise. So with 128MB memory, a 256MB swap would be good. Larger would work but it would put a greater strain on the hard drive - possibly leading the drive to fail quicker than would otherwise be the case. If your computer will handle it an additional RAM card would be the best solution though.
My kernel's 2.6.16.37, and I do have a 256-mb swap partition.
I just wondered the ram usage. Actually I've never seen the swap partition to have any use,
when I check it with free.
Howdy,
slvrldy17 wrote:
>>
So with 128MB memory, a 256MB swap would be good. Larger would work but it would put a greater strain on the hard drive
>>
General rules are just that, and i don't see how the actual size effect drive wear. Unless your talking about the head having to traverse it.
Not really an issue, good buffering of output would be more useful, along with anticipatory facilities (the i/o schedular)
The thing with swap, if you have a good size of ram available you may well see very little use of swap. But it depends on what your running and how many programs your running.
If your going to remaster/create dvd iso's, then you may well need large amounts of swap. I have heard people talk in the range of 5Gib's. But as i haven't tried dvd creation as yet i can't really testify to that directly.
512 Mib's isn't a bad stand by though. That should cover you for any general compression activities you may do, involving large files/directories.
I have heard of some Linux OS's not installing unless 1Gib of swap could be created, to be part of the install. One of the RH's i think. Again i'm not completely sure there.
Earlier kernel, that is, earlier to the current 2.6 range had a limit to the swap they could use. Which was around 256 or so Mib's. But things have moved on from there.
Also, if you find that when you actually need swap to be available, such as, for compression, if it isn't there then you could have programs failing or freeze ups.
A person can always add an extra swap partition in that case, but then they have to ceate/configure it and add a /etc/fstab entry, do a man page look up etc.
I'd go for a 512 Mib min as the disc space will likely be there.
If it's going to be rearly used, then put it down the back of the drive if you can. Or on another drive that will spend most of its' time powered down.
If your having a speed/performance issue it will more likely be something to do with dma or some update deamon facility hogging cycles. Check on the services you start at boot and close down all the stuff you don't really need. Especiall auto updaters. I think SuSE has an issue there.
The caching behavoure of Linux will actually make things run better on restarting programs that have been closed. And will free it self as needed.
Back ground deamons arn't that smart though
jm

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$100.00
Western Digital Blue 3D NAND 500GB Internal 2.5" SSD - WDS500G2B0A
$49.99
Samsung 860 EVO 250GB SSD MZ-76E250 2.5" SATA III Solid State Drive -
$36.99
Intel Solid-State Drive DC S3500 Series 240GB Internal 2.5" (SSDSC2BB240G4P) SSD
$29.99
Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot
$549.00
Fanxiang 256GB 512GB 1TB 2TB 4TB SSD Lot 2.5'' SATA Internal Solid State Drive
$42.99
2 PACK 128 GB SSD M.2 2280 SATA Solid State Drive Major Brands, Samsung, LiteON
$28.00
Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD
$129.99
Netac 120GB 256GB 1TB 2TB Internal SSD 2.5'' SATAIII 6Gb/s Solid State Drive lot
$119.99
Netac 256GB SSD 2.5'' SATA III 6Gb/s Internal Solid State Drive 500MB/s PC/Latop
$40.00