Swap increases constantly

We are using SUSE Linux version 9.X

We have our application developed in J2SDK 1.4.2.X

In our machine we are running two java processes .Those two processes uses memory from RAM , once the memory need is more , swap memory increases.

Two processes which runs are swing application and one messaging application.

Sad part here is , swap memory does not remain constant , it keeps on increasing for every activity and as a result of constant increase in swap memory , load average of CPU increases and thereby reducing the performance of the application.

Is this behaviour is as expected or is there anything needs to be done at OS level such that both processes always use memory from RAM and not from Swap.

Swap is being used because your application is running out of main memory to use. Your process size shouldn't keep increasing. You may have a memory leak somewhere.

Alternatively, the actual memory requirements of your applications are more than what the server provides for. In that case, you will need to add memory to your server.

We have checked the application with some profiling tool and understood that there is no memory leak at all.

Is there any way at OS level to control the swapping ......

Came across certain parameters like swappiness , vfs_cache_pressure....

Is there any use using these params to control the swap ....

f you profiled yor file app. and every thing is okey. That means you need extra real memory. This is normal behavior. Blowtorch is very rigth.

but you can try vmtune may be. Just very veak oportunity. Look at vmtune man page. I can't remember the parameters now. But you can get faster LRU (Last recently used ) chain.

what happens;
your app needs for memory looks at real memory and can't find and uses swapp . So you must release some memory pages more faster.