I have a VPS which is using xen technology.It's got 256mb of RAM and 512MB swap but when I got it, it was using more than 150MB of RAM.
I'm just running lighty and php-cgi .No more software(mysql , sendmail etc) with no CP.
How can I know what is using my RAM ?
how can I set the lighty and php to use swap memory since they don't use any swap?
Would you list all the tasks running (ps auxw)? The process list will provide you an idea what consumes most RAM from its columns VSZ and RSS. But it is hard to calculate the exact usage from the list.
VSZ is the "Memory Allocated" and RSS is the "Memory actually used". Linux is so clever that will identify if you have really "used" the RAM ("Use" means the application fill the allocated RAM with data) so that it can keep performance and swap at an excellent balance. Unfortunately the VPS plan may count you the VSZ for memory usage as your total usage.
What I fine tune my VPS:
1. Remove all unnecessary daemon
2. Fine tune MySQL (particularly disable innodb if not needed, and some cache options)
3. Fine tune Apache (dunno the case for lighttpd)
4. Fine tune PHP (eaccelerator options)
These actions reduce my RAM usage from 240MB to 95MB