resize tomcat heap
#before heap size
#fix heap size
[root@localhost min]# jmap -heap 109487 Attaching to process ID 109487, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.252-b09 using thread-local object allocation. Parallel GC with 2 thread(s) Heap Configuration: MinHeapFreeRatio = 0 MaxHeapFreeRatio = 100 MaxHeapSize = 987758592 (942.0MB) NewSize = 20971520 (20.0MB) MaxNewSize = 329252864 (314.0MB) OldSize = 41943040 (40.0MB) NewRatio = 2 SurvivorRatio = 8 MetaspaceSize = 21807104 (20.796875MB) CompressedClassSpaceSize = 1073741824 (1024.0MB) MaxMetaspaceSize = 17592186044415 MB G1HeapRegionSize = 0 (0.0MB) Heap Usage: PS Young Generation Eden Space: capacity = 278921216 (266.0MB) used = 22089864 (21.06653594970703MB) free = 256831352 (244.93346405029297MB) 7.919750357032719% used From Space: capacity = 23592960 (22.5MB) used = 17890904 (17.062095642089844MB) free = 5702056 (5.437904357910156MB) 75.83153618706598% used To Space: capacity = 25165824 (24.0MB) used = 0 (0.0MB) free = 25165824 (24.0MB) 0.0% used PS Old Generation capacity = 51380224 (49.0MB) used = 25454368 (24.275177001953125MB) free = 25925856 (24.724822998046875MB) 49.54117755500638% used 19498 interned Strings occupying 2433080 bytes.
#fix heap size
[root@localhost bin]# vi catalina.sh JAVA_OPTS="$JAVA_OPTS $JSSE_OPTS -Xms2048m -Xmx2048m" [root@localhost bin]# ./startup.sh Using CATALINA_BASE: /opt/tomcat/apache-tomcat-8.5.42 Using CATALINA_HOME: /opt/tomcat/apache-tomcat-8.5.42 Using CATALINA_TMPDIR: /opt/tomcat/apache-tomcat-8.5.42/temp Using JRE_HOME: /usr Using CLASSPATH: /opt/tomcat/apache-tomcat-8.5.42/bin/bootstrap.jar:/opt/tomcat/apache-tomcat-8.5.42/bin/tomcat-juli.jar Tomcat started. [root@localhost bin]# ps -ef|grep tomcat root 121692 1 99 21:55 pts/1 00:00:17 /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat/apache-tomcat-8.5.42/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Xms2048m -Xmx2048m -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /opt/tomcat/apache-tomcat-8.5.42/bin/bootstrap.jar:/opt/tomcat/apache-tomcat-8.5.42/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat/apache-tomcat-8.5.42 -Dcatalina.home=/opt/tomcat/apache-tomcat-8.5.42 -Djava.io.tmpdir=/opt/tomcat/apache-tomcat-8.5.42/temp org.apache.catalina.startup.Bootstrap start root 121813 101213 0 21:55 pts/1 00:00:00 grep --color=auto tomcat [root@localhost bin]# jmap -heap 121692 Attaching to process ID 121692, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.252-b09 using thread-local object allocation. Parallel GC with 2 thread(s) Heap Configuration: MinHeapFreeRatio = 0 MaxHeapFreeRatio = 100 MaxHeapSize = 2147483648 (2048.0MB) NewSize = 715653120 (682.5MB) MaxNewSize = 715653120 (682.5MB) OldSize = 1431830528 (1365.5MB) NewRatio = 2 SurvivorRatio = 8 MetaspaceSize = 21807104 (20.796875MB) CompressedClassSpaceSize = 1073741824 (1024.0MB) MaxMetaspaceSize = 17592186044415 MB G1HeapRegionSize = 0 (0.0MB) Heap Usage: PS Young Generation Eden Space: capacity = 537395200 (512.5MB) used = 431985056 (411.9730529785156MB) free = 105410144 (100.52694702148438MB) 80.38498594702745% used From Space: capacity = 89128960 (85.0MB) used = 0 (0.0MB) free = 89128960 (85.0MB) 0.0% used To Space: capacity = 89128960 (85.0MB) used = 0 (0.0MB) free = 89128960 (85.0MB) 0.0% used PS Old Generation capacity = 1431830528 (1365.5MB) used = 22316296 (21.28247833251953MB) free = 1409514232 (1344.2175216674805MB) 1.558585011535667% used 20065 interned Strings occupying 2534056 bytes. [root@localhost bin]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 17G 16G 2.0G 89% / devtmpfs 1.9G 0 1.9G 0% /dev tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs 1.9G 195M 1.7G 11% /run tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup /dev/xvda1 1014M 179M 836M 18% /boot tmpfs 377M 44K 377M 1% /run/user/1000 /dev/sr0 67M 67M 0 100% /run/media/min/Citrix VM Tools overlay 17G 16G 2.0G 89% /var/lib/docker/overlay2/a1531f15d9370a70c0490f5b008a0ce775b75f45e6f7bc0c8f60230b3ea1c8c7/merged shm 64M 0 64M 0% /var/lib/docker/containers/5b970fbb9bf1967fed1bac5e6257f2a257b4fa817f8dac33586a86eb8fdc8d22/mounts/shm tmpfs 377M 4.0K 377M 1% /run/user/42 tmpfs 377M 40K 377M 1% /run/user/0
댓글
댓글 쓰기