Linux Question on getting app to use physical memory over virtual memory

Are there settings that will force the game to stick to physical memory instead of virtual memory.

My ubuntu server has 26gigs of physical memory...
 
Per google:

There is an OS setting called swappiness:

1. Adjust Swappiness:
This parameter tells the kernel how aggressively to swap data to disk.

  • View current swappiness: cat /proc/sys/vm/swappiness

  • Temporary change: sudo sysctl vm.swappiness=10 (or another low number like 1 for minimal swapping)

  • Permanent change: Add vm.swappiness=10 to /etc/sysctl.conf
Another settings is vfs_cache_pressure
The default is 100 and the recommened range is 50-200.
The setting controls the propensity to use swap memory space.
 
Last edited:
A note.

Unity will attempt to address swap. It isn't using it. It is just checking to make sure it is there in case it might need to use it later.

Setting up a server will require an 8GB Swap to be configured. (default is usually 2GB when installing the OS.)

Swap is primarily used for long-term program storage when code is not being immediately used, or in cases where the program runs out of usable RAM. I will create the 8GB Swap on Linux install, and then set swappiness to 20. It won't get used unless there really is no other option but to use it. Setting this too low can cause issues with some programs.
 
A note.

Unity will attempt to address swap. It isn't using it. It is just checking to make sure it is there in case it might need to use it later.

Setting up a server will require an 8GB Swap to be configured. (default is usually 2GB when installing the OS.)

Swap is primarily used for long-term program storage when code is not being immediately used, or in cases where the program runs out of usable RAM. I will create the 8GB Swap on Linux install, and then set swappiness to 20. It won't get used unless there really is no other option but to use it. Setting this too low can cause issues with some programs.
Correct. Setting swappiness too low, especially with too little installed RAM will cause OMM errors and premature program termination. The main complaint will be slowness, freezes, and just general non responsiveness.
 
Back
Top