# ct-study-jvm-benchmark-test **Repository Path**: cachetian/ct-study-jvm-benchmark-test ## Basic Information - **Project Name**: ct-study-jvm-benchmark-test - **Description**: JVM heap memory benchmark test - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-30 - **Last Updated**: 2021-01-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # java-jvm-benchmark-test ## test case 01 - hello-world -XX:PermSize=size changed to -XX:MetaspaceSize=size ```shell script java -Xmx4096m -XX:MaxPermSize=1024m HelloWorldMain java -Xmx4096m -XX:MetaspaceSize=1024m HelloWorldMain java -Xms4096m -Xmx4096m -XX:MetaspaceSize=1024m -XX:MetaspaceSize=1024m HelloWorldMain ``` #### referenced links: https://stackoverflow.com/questions/5891123/specifying-jvm-arguments-when-calling-a-jar-file https://stackoverflow.com/questions/12114174/what-does-xxmaxpermsize-do https://www.oracle.com/java/technologies/javase/gc-tuning-6.html https://stackoverflow.com/questions/22634644/java-hotspottm-64-bit-server-vm-warning-ignoring-option-maxpermsize https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/f0/cec51dabd1461b87e4db9e3958710e/loio44a438452ba94658a8e21f998d248fa4_HiRes.png ![JVM](https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/f0/cec51dabd1461b87e4db9e3958710e/loio44a438452ba94658a8e21f998d248fa4_HiRes.png) https://www.cnblogs.com/SIHAIloveYAN/p/12023615.html > -Xms 初始堆的大小,也是堆大小的最小值,默认值是总共的物理内存/64(且小于1G)。默认情况下,当堆中可用内存小于40%,堆内存会开始增加,一直增加到-Xmx的大小。 https://stackoverflow.com/questions/31455644/should-i-set-a-maxmetaspacesize/31463972#31463972 > As I commented on the previous answer the reasons for setting a limit on those memory pools is different. If your users previously increased the MaxPermSize above the default that probably was either to avoid Full GCs / concurrent mode failures with CMS or because their applications genuinely needed a lot of perm gen space. Decreasing the the metaspace limit from its effectively infinite default would serve an entirely different purpose: Avoiding unbounded metaspace growth. The thing is that that's just an upper limit. The actually committed, i.e. current metaspace size will be smaller. In fact, there is a setting called MaxMetaspaceFreeRatio (default 70%) which means that the actual metaspace size will never exceed 230% of its occupancy. And for it to grow it first would have to fill up, forcing a garbage collection (metaspace full) in an attempt to free objects and only when it cannot meet its MinMetaspaceFreeRatio (default 40%) goal it would expand the current metaspace to no more than 230% of the occupancy after the GC cycle. So in practice the actual metaspace size should stabilize within a band close relative to its actual need unless the application is continuously leaking classloaders/classes or generating an enormous amount of dynamic code. TL;DR: There may be reasons to restrict metaspace size, but they likely are different to the original reasons for setting the perm gen sizes. Therefore the need should be re-evaluated. ``` #### 介绍 JVM heap memory benchmark test #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)