`

java-jvm usage analytics

 
阅读更多

  as mentioned in title,i will make  analytics between two tomcats which both running a solr app.

 

1.cases comparison

2.analytics

 

1.cases comparison

tomcat Xms Xmx Xmn NewRatio

SurvivorRatio

mem used by

checking 'top-RES' item

resulted: actual new size

A 6g 8g 1.5g - 6 4.1g 1.5g
B 20g 20g - 4 6 4.9g 4g
               

 these are the jvm allocation by checking 'jmap -heap pid'

 tomcat A

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 8589934592 (8192.0MB)
   NewSize          = 1572864000 (1500.0MB)
   MaxNewSize       = 1572864000 (1500.0MB)
   OldSize          = 5439488 (5.1875MB)
   NewRatio         = 4
   SurvivorRatio    = 6
   PermSize         = 67108864 (64.0MB)
   MaxPermSize      = 104857600 (100.0MB)

Heap Usage:
New Generation (Eden + 1 Survivor Space):
   capacity = 1376256000 (1312.5MB)
   used     = 782190664 (745.9551467895508MB)
   free     = 594065336 (566.5448532104492MB)
   56.83467785063244% used
Eden Space:
   capacity = 1179648000 (1125.0MB)
   used     = 738672576 (704.4530639648438MB)
   free     = 440975424 (420.54693603515625MB)
   62.61805013020833% used
From Space:
   capacity = 196608000 (187.5MB)
   used     = 43518088 (41.50208282470703MB)
   free     = 153089912 (145.99791717529297MB)
   22.134444173177084% used
To Space:
   capacity = 196608000 (187.5MB)
   used     = 0 (0.0MB)
   free     = 196608000 (187.5MB)
   0.0% used
concurrent mark-sweep generation:
   capacity = 4869586944 (4644.0MB)
   used     = 2786356080 (2657.2762298583984MB)
   free     = 2083230864 (1986.7237701416016MB)
   57.2195570598277% used
Perm Generation:
   capacity = 67108864 (64.0MB)
   used     = 37844912 (36.09172058105469MB)
   free     = 29263952 (27.908279418945312MB)
   56.39331340789795% used

 

 tomcat B

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 21474836480 (20480.0MB)
   NewSize          = 1310720 (1.25MB)
   MaxNewSize       = 17592186044415 MB
   OldSize          = 5439488 (5.1875MB)
   NewRatio         = 4
   SurvivorRatio    = 6
   PermSize         = 67108864 (64.0MB)
   MaxPermSize      = 104857600 (100.0MB)

Heap Usage:
New Generation (Eden + 1 Survivor Space):
   capacity = 3758096384 (3584.0MB)
   used     = 1372982952 (1309.3785781860352MB)
   free     = 2385113432 (2274.621421813965MB)
   36.53400050742285% used
Eden Space:
   capacity = 3221225472 (3072.0MB)
   used     = 1277111448 (1217.948387145996MB)
   free     = 1944114024 (1854.051612854004MB)
   39.646757394075394% used
From Space:
   capacity = 536870912 (512.0MB)
   used     = 95871504 (91.43019104003906MB)
   free     = 440999408 (420.56980895996094MB)
   17.85745918750763% used
To Space:
   capacity = 536870912 (512.0MB)
   used     = 0 (0.0MB)
   free     = 536870912 (512.0MB)
   0.0% used
concurrent mark-sweep generation:
   capacity = 17179869184 (16384.0MB)
   used     = 1514222648 (1444.0752487182617MB)
   free     = 15665646536 (14939.924751281738MB)
   8.813935844227672% used
Perm Generation:
   capacity = 67108864 (64.0MB)
   used     = 37938264 (36.180747985839844MB)
   free     = 29170600 (27.819252014160156MB)
   56.532418727874756% used

 

2.analytics

  A.from all of info above,we know that :

   RES~new gen-size + one survivor-size+ old gen's used-size + perm used= new eden + 2* survivor + old gen's used + perm used

   so the above tomcat A's RES = 4.1g ~ 1312.5MB + 187.5MB + 2657mb + 36mb= 4193mb 

   that means the total mem used is always couted by base part say 'new size' ,added by actual used old size and used perm size.in fact it's reasonable.

  B.the Xmx is the large size of the heap ,so jvm does not always reach it,but what about Xms?is it the min pre-allocated size guaranteed by jvm ?

  nope,we know,the RES is far less than it.

  C.jvm misc gen allcotion for mem.the tomcat B 's 'actual new size' is 4g >> 1.5g which tomcat A used,but u will find that the actual used mem size is less than the A.

  A current used mem:704+41+2657 ~2.4g

  B 's one:1217+91 +1444 ~ 2.7g

   that means 2.7-2.4=300mb objects have been destroyed in 'new area';

   and the old size used:A/2657 ~ 2 * B/1444, that means the Tomcat A jvm will first come into CMS compared to B;and of course,the A 's new-collection-time is much less than B,about half of time saved,say ~25ms .

 

 

0
0
分享到:
评论

相关推荐

    nginx-upstream-jvm-route-1.15

    在"nginx-upstream-jvm-route"中,"jvm-route"表示Nginx与Java应用服务器(如Tomcat)之间的深度集成。这种集成可以实现更精细的路由控制,比如根据请求的某些特性(如URL、请求头等)将请求定向到特定的JVM实例,以...

    java-jvm虚拟机原理.ppt

    java-jvm虚拟机原理.ppt java-jvm虚拟机原理.ppt

    metrics-jvm-3.1.5-API文档-中文版.zip

    赠送jar包:metrics-jvm-3.1.5.jar; 赠送原API文档:metrics-jvm-3.1.5-javadoc.jar; 赠送源代码:metrics-jvm-3.1.5-sources.jar; 赠送Maven依赖信息文件:metrics-jvm-3.1.5.pom; 包含翻译后的API文档:...

    Java-jvm.png

    java jvm 优化思维导图,包含java 虚拟机所有知识点,如类加载、垃圾回收(垃圾回收算法、垃圾处理器、GC种类、GC常用参数及配置、GC问题排查等)、内存布局等

    kotlinx-coroutines-io-jvm-0.1.1.jar

    kotlinx-coroutines-io-jvm-0.1.1.jar

    JAVA-JVM-面试题

    JAVA-JVM-面试题,java面试题

    metrics-jvm-3.1.5-API文档-中英对照版.zip

    赠送jar包:metrics-jvm-3.1.5.jar; 赠送原API文档:metrics-jvm-3.1.5-javadoc.jar; 赠送源代码:metrics-jvm-3.1.5-sources.jar; 赠送Maven依赖信息文件:metrics-jvm-3.1.5.pom; 包含翻译后的API文档:...

    JAVA-JVM-详解/调优/进阶

    JAVA-JVM-详解/调优/进阶

    【java】QQ官方机器人Java-JVM-kotlinSDKQQbotsdkqq机器人sdk.zip

    【java】QQ官方机器人Java-JVM-kotlinSDKQQbotsdkqq机器人sdk

    java -jvm 内存分配和jvm调优

    Java JVM(Java虚拟机)内存分配与调优是Java开发者必须掌握的重要技能,它涉及到程序的性能优化和稳定性。在Java应用中,JVM扮演着至关重要的角色,它负责解析字节码、管理内存以及执行线程等。本文将深入探讨JVM...

    5.java-JVM 内存模型.md

    5.java-JVM 内存模型

    【java】QQ官方机器人Java-JVM-kotlinSDKQQbotsdkqq机器人sdk_pgj.zip

    【java】QQ官方机器人Java-JVM-kotlinSDKQQbotsdkqq机器人sdk_pgj

    JAVA-JVM-全面/发展史/GC.zip

    这个压缩包“JAVA-JVM-全面/发展史/GC.zip”显然包含了关于Java、JVM、垃圾回收(GC)及其历史的深入学习资料,特别是通过“JAVA-笔记.pdf”这样的文档形式。 Java的发展史可以追溯到1991年,由Sun Microsystems的...

    mini-jvm使用 Java 8 实现 jvm

    《迷你Java虚拟机(Mini-JVM):基于Java 8的实现详解》 在计算机科学领域,Java虚拟机(JVM)是Java平台的核心组成部分,它负责执行Java字节码,使得Java应用程序可以在任何支持JVM的平台上运行,实现“一次编写,...

    nginx-upstream-jvm-route nginx共享Session

    标题 "nginx-upstream-jvm-route nginx共享Session" 涉及到的是在使用Nginx作为反向代理服务器时,如何实现多个Java应用服务器(通常指的是JVM实例)之间的Session共享。这通常在构建高可用性和负载均衡的Web服务...

    ant-eclipse-jvm1.2-1.0.jar.zip

    在早期的Java版本中,如JVM1.2,有一些特性与现代版本不同,因此这样的适配器或者库是必要的,以确保兼容性。 在实际开发中,开发者可能需要在Eclipse中配置Ant构建路径,将这个JAR文件添加到构建路径中,以便在...

    java11-jvm白皮书

    Java 11 JVM 白皮书是一份详细阐述Java虚拟机(JVM)在Java 11版本中的特性和优化的文档。这份白皮书主要关注JVM的内部工作原理,包括垃圾收集、内存管理、类加载机制、性能优化等方面,是Java开发者深入理解Java...

    Java-JVM调优总结

    ### Java-JVM调优总结 #### 一、引言 在现代软件开发中,Java 作为一种广泛使用的编程语言,其应用程序的性能优化至关重要。而 JVM(Java Virtual Machine)作为 Java 程序运行的基础环境,对其进行合理的调优可以...

    java毕业设计-JVM内存模型和垃圾收集PPT37页-JVM内存模型和垃圾收集

    jvm--java毕业设计-JVM内存模型和垃圾收集PPT37页--JVM内存模型和垃圾收集

Global site tag (gtag.js) - Google Analytics