NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using swap though there's plenty of mem free



Jonathan Schleifer wrote:
Even after tweakig vm.filemax now:

Memory: 171M Act, 90M Inact, 2120K Wired, 22M Exec, 23M File, 63M Free
Swap: 257M Total, 63M Used, 194M Free

63 MB RAM unused. Not even for file cache. And still 63 MB swapped out?
Why the hell that? I can understand that file cache is kept and instead
pages swapped out, but in this case? There's really no reason for that
kind of behaviour!
As the others pointed out there is a reason for this kind of
behaviour (and i've this not only on NetBSD). When some
memory-intensive job starts up, other filecache is reduced, some thing are paged/swapped out. When this job is finished
these things are not swapped/paged in - the system doesn't which
of them will necessary in the near future (swapping/paging in
things that won't be accesed makes no sense they would need to
swapped out upon next memory request).

To reduce nuisance, you can try something like this:
-identify this memory intesive job (maybe it is some cron job), upon
finishing issue some request to your application so it get swapped in
- mlock/mlockall(2) (beware this may require more memory than
you think, also this memory-intensive jobs may really slow down)
- play with limits for this memory intensive jobs (I not sure if it
possible and how to do it).

Best Regards,
 Przemek Kacprzak



Home | Main Index | Thread Index | Old Index