Originally Posted by vicky007aggrwal
swap memory is getting used fully even when the Free space is available in RAM
My application setting
RAM- 10 G
SWAP 3 G
Use of some swap despite free ram is common. Use of 3GB of swap despite free ram is unusual, but still might be normal behavior. You haven't provided enough info.
Linux does not pull pages back from swap until they are accessed again. So if memory was used and then freed, you might leave a lot of swap space in use.
If you do have a problem, it is likely a memory leak in some process. To further investigate that, you would need to look into those processes with high virtual memory use and then look into whether that use is "anonymous" (possible memory leak) vs. file mappings (which don't contribute to swap usage).
Originally Posted by jefro
I'd maybe start by changing the swappiness of your swap.
Might end up having to force swap to clear based on time or metric.
Both very bad ideas. You are attacking the symptom rather than the problem and doing it in a way that does more harm than just ignoring the problem would do.
If there is a memory leak or other problem, you need to start by identifying the problem processes, then deal with it or ignore it based on understanding what those processes are doing. But "deal with it" will not involve either of those methods of attacking the symptom.