My PC has 8 Gb of ram. Is there any way to make ubuntu use most of it? I mean rarely drop caches and keep once opened programms in ram longer, preload apps on boot, etc.
You could make a ramdisk for certain directories using
For example for the
However, it should be noted that the contents get lost with each reboot.
Anther suitable directoriy might be
Use 1G of your RAM:
or, use 10% of your available RAM:
Preloading should be easy enough -- since linux caches/buffers as much as possible, simply cat the libs/binaries you want to "preload" to /dev/null -- that should warm up the cache. Start a script like the following at boot:
This will waste a lot of time by cat'ing some libraries again and again, it is a bit more complicated to preload the needed libraries only once - but the impact depends on the length of the PROGS-array.
The rest (rarely drop caches, ...) is pretty much taken care of by the system by default -- it takes what it can use and let it go only if need be.
I've found the solution how to use RAM. Create the script with the following content:
I run this script after login. To do this just add the autostart application with this content:
It takes about 40 seconds to complete. The programms load much faster.