当前位置:网站首页>JVM tuning notes
JVM tuning notes
2022-04-22 04:34:00 【m0_ sixty million seven hundred and twenty-one thousand five hu】
java -Djava.security.egd=file:/dev/./urandom -Xms128m -Xmx128m -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=128M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/javadump -jar user.jar &
java
-Djava.security.egd=file:/dev/./urandom
-Xms128m
-Xmx128m
-XX:MetaspaceSize=128M
-XX:MaxMetaspaceSize=128M
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/var/log/javadump
-jar user.jar &
1)-Djava.security.egd=file:/dev/./urandom : Non blocking entropy source is adopted (entropy source)
It is related to random number generation ,tomcat In the server sessionId.
/dev/random The device will return random bytes less than the total entropy pool noise .
/dev/random It can generate high randomness public key or one-time codebook . If entropy pool is empty , Yes /dev/random The read operation of will be blocked , Until enough ambient noise is collected
/dev/urandom It's a non blocking generator :
(”unlocked”, Nonblocking random number generator ), It reuses the data in the entropy pool to produce pseudo-random data . This is right. /dev/urandom The read operation of will not block , But the entropy of its output may be less than /dev/random Of . It can be used as a pseudo-random number generator to generate lower strength passwords , Not recommended for generating high-strength long-term passwords .
But why is the value here in dev and random Add a point between them ? It's because of one jdk Of bug, In this bug There's feedback from someone in your connection securerandom.source Set to /dev/urandom It's still used /dev/random, There are alternative solutions , One of the workarounds is to securerandom.source Set to /dev/./urandom Talent .
I have seen Jdk Related source code , When java.security.egd The value is file:/dev/urandom perhaps file:/dev/random when , All use blocked entropy sources , So that's why file:/dev/urandom Don't take effect , And a little more in the middle will take effect .
2)java Setting of heap memory in , Generally set to the same size
-Xms128m : The initial heap size is 128M
-Xmx128m : Maximum heap size is 128M
3) Meta space , The memory used is local memory
-XX:MetaspaceSize=128M
-XX:MaxMetaspaceSize=128M : This parameter is used to limit Metaspace The ceiling on growth , To prevent... From being caused by certain circumstances Metaspace Unlimited use of local memory , Affecting other procedures . The default value of this parameter on this machine is 4294967295B( about 4096MB).
4) out of memory
-XX:+HeapDumpOnOutOfMemoryError : Generated when memory overflows heapdump file
Parameters :
-XX:HeapDumpPath=/var/log/javadump : After memory overflow ,heapdump Where documents are stored
/dev/urandom:
Started TestApplication in 7.388 seconds (JVM running for 8.37)
Started TestApplication in 7.064 seconds (JVM running for 8.06)
Started TestApplication in 7.376 seconds (JVM running for 8.361)
/dev/random
Started TestApplication in 7.144 seconds (JVM running for 8.196)
Started TestApplication in 7.38 seconds (JVM running for 8.372)
5) Other parameters :
-Xmn:64M: The memory of the new generation is 64M
-XX:SurvivorRatio=2: The proportion :Eden/From
-XX:NewRatio=2: The proportion : Old age / The new generation
-XX:PermSize=10M: Method area ( Forever ) Memory size
-XX:MaxPermSize=10M: Method area ( Forever ) The maximum memory is 10M
-XX:MaxDirectMemorySize: Direct memory settings , If you don't specify , Default and Java Heap maximum (-Xmx Appoint ) equally
-XX:+PrintGCDetails: see GC journal
-XX:+UseSerialGC: Configure the serial recycler
-XX:+PrintCommandLineFlags: You can output implicit or explicit parameters to the virtual machine
版权声明
本文为[m0_ sixty million seven hundred and twenty-one thousand five hu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210946587691.html
边栏推荐
- 7_ Data analysis - Evaluation
- AT32 MCU F435/437 DFU DEMO
- Knowledge points related to compliance type
- Opensca version upgrade | opensca v1.0 Release of version 0.4
- Will the expired data of redis be deleted immediately?
- 队列第二篇
- SCI论文写作--IEEE期刊的Word模板(LaTeX也有)
- 论文阅读 (48):A Library of Optimization Algorithms for Organizational Design
- 二叉树的层序遍历
- C entry - check the ID number with regular expressions.
猜你喜欢

6_ Data analysis modeling

SCI paper writing -- word template of IEEE Journal (also available in latex)

sqlilabs(25a-26)

How does IOT platform realize business configuration center

Dynamic | hanging mirror safety R & D management system has passed CMMI3 international certification

How much do you know about the testing methods of software testing?

权威机构统计:2021 年最佳数据中心网络公司,中国华为和H3C上榜

NVIDIA, Wanxiang, fengyuzhu, dream chaser Fund... Talk about "new opportunities for yuan universe and industry" - 2022 yuan universe cloud Summit

How did Jian Daoyun, who started a business in a small team of 10 people and now has an income of more than 100 million without financing, do it?

04-Functions
随机推荐
C language learning record -- use and analysis of string function (1)
L3-022 地铁一日游 (30 分)【floyd+dfs】
Verify simple sorting using logarithm
Target detection - lightweight network (as of April 21, 2022)
WebSocket学习
Introduction to C - parallel programming
Unity 简单UI前缀树红点系统
DNS domain name system - directory service of the Internet
Pgpool II 4.3 Chinese Manual - introductory tutorial
Memory model and namespace knowledge points summary
How did Jian Daoyun, who started a business in a small team of 10 people and now has an income of more than 100 million without financing, do it?
04-Functions
Revit data processing (III)
Cisco packet tracker experiment set
Opensca version upgrade | opensca v1.0 Release of version 0.4
pipeline communication
Non reentrant information about gethostbyname()
Training summary report
MUI-弹出菜单
如何在 Acrobat Pro DC 与其它文件合并创建单个 PDF 文件?