+. memory space / number of large memory pages
- each huge page size : 16 MB
- jvm heap size : 2048 MB
- jvm instances : 4
> total memory space for jvm heap
: 2048 MB * 4 (jvm) = 8 GB
total memory space for huge page
: (1024 (1kb) * 1024 (1mb) * 1024 (1gb) * 2 (jvm heap) * 4 (jvm count)) - 1 = 8589934591
total huge page number
: 1024 (1gb) * 2 (jvm heap) * 4 (jvm count) / 16 (huge page size) = 512
+. allocate the shared memory segement
#. echo 8589934591 > /proc/sys/kernel/shmmax (temporary configuration)
#. vi /etc/sysctl.conf (permanent configuration)
kernel.shmmax = 8589934591
+. set the number of huge pages
#. echo 512 > /proc/sys/vm/nr_hugepages (temporary configuration)
#. vi /etc/sysctl.conf (permanent configuration)
vm.nr_hugepages = 512
+. set the user group to access the huge pages (ex. user's group id : 1001)
#. echo 1001 > /proc/sys/vm/hugetlb_shm_group (temporary configuration)
#. vi /etc/sysctl.conf (permanent configuration)
vm.hugetlb_shm_group = 1001
+. run jvm with huge page support option
> java -Xlp -Xmn1400m -Xms2048m -Xmx2048m -XlockReservation -Xnoloa -XtlhPrefetch -Xaggressive -Xcompressedrefs -Xconcurrentlevel0
> java -d64 -server -Xms2048m -Xmx2048m -Xss192k -XX:+UseLargePages -XX:LargePageSizeInBytes=2m -XX:+UseParNewGC
+. check the huge pages in memory
#. cat /proc/meminfo | grep Huge
'Linux (pLinux & x86)' 카테고리의 다른 글
IBM Installation Toolkit: Loading Linux on POWER (0) | 2013.05.28 |
---|---|
Affinity Control with taskset (0) | 2013.05.22 |
RHEL의 repository를 CentOS 혹은 Daum 으로 변경하기... (0) | 2013.02.20 |
idle시 HDD spindown 을 통해 HDD saving 모드 지정 (0) | 2013.01.17 |
LinuxMint 에서 compiz 설정하기... (0) | 2013.01.17 |