SWAP usage on ubuntu

How can i reduce swap usage of my openhab setup on ubuntu ? i have a lots of available ram however openhab is still using quite a bit of swap

You might have to ask on the Ubuntu forums. When and how a program gets pi into swap is controlled by the kernel.

Hi Rich, thanks for the reply. I was wondering if there is either an openhab or a java config parameter which can help in this situation? BTW - this is not on PI , but ubuntu 16.04 on a x86 32 bit machine

From what I could tell scanning some Stackoverflow and related forums and blog postings is about all you can do to prevent a program from swapping are:

  • Disable swapping on the system entirely
  • Add more RAM
  • Close down programs/services to free up more RAM

The only reason OH should be hitting the SWAP space is because it has grown too large in memory and/or OH isn’t doing much so when some other program or service runs the kernel sees it isn’t active and swaps it out so these new programs can run in RAM.

1 Like