<div dir="ltr">Hello guys,<div><br></div><div>I was checking Sunjammer and I found the currently we are swapping around 407 MB but we have plenty of physical memory free yet.</div><div><br></div><div>Free -m shows:</div><div><font face="monospace, monospace"><br></font></div><div><div><font face="tahoma, sans-serif">                  total       used         free     shared    buffers     cached</font></div><div><font face="tahoma, sans-serif">Mem:         11992     11673        319          0       1539       5981</font></div><div><font face="tahoma, sans-serif">-/+ buffers/cache:      4151       7841</font></div><div><font face="tahoma, sans-serif">Swap:         8191         407       7784</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">According to this, we have around 7841 MB free (~ 319 + 1539 + 5981). We must consider that buffers and cache memory are unused memory that Linux borrows for disk caching (for improve performance). But at the end this is free memory. Applications can dispose of it immediately.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">So what are we swapping? The answer is the swappiness value. This is a </font><font face="arial, helvetica, sans-serif">tweakable setting that controls how often the swap file is used. A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (we run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.</font></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">By default, Ubuntu comes with a default value of 60 (</span><font face="arial, helvetica, sans-serif">cat /proc/sys/vm/swappiness). This means that the swap memory will be used quite often is the memory usage is over the half usage. I consider that we should lower this value to 10. With this setting, the swap memory will be only used when the RAM usage is around 90%. We want to avoid disk usage as long as possible.</font></div><div><br></div><div>Suggestions and comments are welcome.</div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Best regards,</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Samuel C.</font></div></div>