Large Pages說明
sun文檔: http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html
說白了,就是在操做系統級別上,針對進程的虛擬內存空間,使用大內存頁,避免頻繁的進行頁換入換出,出現系統抖動。一樣使用大內存分頁,也會有一些負面影響,兩快大內存分頁之間會出現一些內存碎片,從而影響總體系統的性能,當一旦沒有足夠的大內存塊時,整個OS下系統進程又會將原先的大內存打散恢復默認的內存分頁。
javascript
Linux下如何配置large Page
Large page support is included in 2.6 kernel. Some vendors have backported the code to their 2.4 based releases. To check if your system can support large page memory, try the following:
html
If the output shows the three "Huge" variables then your system can support large page memory, but it needs to be configured. If the command doesn't print out anything, then large page support is not available. To configure the system to use large page memory, one must log in as root, then:
Increase SHMMAX value. It must be larger than the Java heap size. On a system with 4 GB of physical RAM (or less) the following will make all the memory sharable:
java
Specify the number of large pages. In the following example 3 GB of a 4 GB system are reserved for large pages (assuming a large page size of 2048k, then 3g = 3 x 1024m = 3072m = 3072 * 1024k = 3145728k, and 3145728k / 2048k = 1536):
web
Note the /proc values will reset after reboot so you may want to set them in an init script (e.g. rc.local or sysctl.conf).
參數配置
sun jdk :
shell
jrockit jdk :
oracle