linux virtual memory optimization

Linux virtual memory optimization
Virtual memory optimization
  Linux small fruit fruit finishing First check the usage of virtual memory, use the command
  # free
  to check the memory usage of the current system.
  Generally speaking, the physical memory of linux is almost completely used. This is very different from windows. Its memory management mechanism makes full use of system memory. It is not the same as windows using some virtual memory no matter how large the memory is. This needs attention.
  The default configuration of virtual memory under Linux can be viewed through the command
  # cat /proc/sys/vm/freepages
  . The three numbers displayed are the current system: minimum memory blank pages, minimum memory blank pages and maximum memory blank pages.
  Note that the principle of the system using virtual memory here is: if the number of blank pages is lower than the maximum blank page setting, the disk swap space is used. When the minimum blank page setting is reached, memory swapping is used (Note: This is obtained by me looking at some information, and I need to observe it myself when applying it, but this does not affect our configuration of new virtual memory parameters).
  Memory is generally allocated at 4k bytes per page. The minimum memory blank page setting is 2 times the amount of memory in the system; the minimum memory blank page setting is 4 times the memory quantity; the maximum memory blank page setting is 6 times the system memory. These values ​​are determined at system startup.
  Generally speaking, when configuring the virtual memory configuration allocated by the system, I personally think that increasing the maximum memory blank page is a better configuration method. Take 1G memory configuration as an example:
  the original configuration ratio can be modified to:
  2048 4096 6444
  via command
  # echo "2048 4096 6444" > /proc/sys/vm/freepages
  Because the maximum blank page configuration is increased, the memory can be used more efficiently.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326487521&siteId=291194637