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

RAM-HOL-SAM52CPU RAM USB-C Powered Dock Samsung Tab Active4 Pro & Tab Active Pro
$81.99
Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$60.00
Samsung 870 EVO 4TB 2.5" SATA III Internal SSD (MZ-77E4T0B/AM)
$310.00
New Samsung 512GB FIT Plus USB 3.2 Gen 1 Type-A Flash Drive MUF-512AB/AM NEW
$120.00
RAM-HOL-SAM60CPU RAM USB-C Powered Dock for Samsung Tab Active5 - 3 - 2
$81.99
Samsung PM961 512GB PCIe Gen 3x4 NVMe 2280 M.2 SSD MZVLW512HMJP-000D1
$60.00
RAM-GDS-SKIN-SAM54-NG-1 RAM Mounts IntelliSkin® Next Gen for Samsung Tab Active4
$93.99
Samsung 8GB DDR5 5600MHz SODIMM Laptop RAM PC5-44800 CL46 M425R1GB4BB0-CWM
$99.99
NEW Samsung NoteBook NT930QCG touch LCD Full Screen Assembly Blue
$225.77
Original for Samsung NP950QCG-K01US LCD Screen Touch Full Top Assembly FHD Blue
$299.00