当前位置:网站首页>Client and server working modes of JVM
Client and server working modes of JVM
2022-06-29 06:16:00 【PacosonSWJTU】
【README】
JVM Server Patterns and client mode , The main difference is :
-Server When mode starts , Slower , But once it's up and running , Performance will be greatly improved .
as a result of : When the virtual machine is running -client In mode , The code used is C1 The lightweight compiler for , and -server The virtual machine started in mode is relatively heavyweight , code-named C2 The compiler . C2 Than C1 Compiler compilation is relatively thorough ,, After the service , Higher performance .
java -version You can see directly that you are using client still server
【1】client
C:\Documents and Settings\Administrator>java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing) 【2】server
[[email protected] ~]# java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode) The two modes can be switched by changing the configuration (jvm.cfg The configuration file ) To achieve :
32 Bit virtual machine in directory JAVA_HOME/jre/lib/i386/jvm.cfg,
64 The position is JAVA_HOME/jre/lib/amd64/jvm.cfg, at present 64 Bit only supported server Pattern , The configuration contents are as follows
-server KNOWN
-client KNOWN
-hotspot ALIASED_TO -client
-classic WARN
-native ERROR
-green ERROR When JVM Used to start GUI The interface is suitable for interactive application client Pattern , When JVM Recommended for running server daemons Server Pattern .
JVM stay client Mode default -Xms yes 1M,-Xmx yes 64M;JVM stay Server Mode default -Xms yes 128M,-Xmx yes 1024M. We can run :java -version Check it out. jvm What mode does the default work in .
【3】 Command line
【3.1】-Xms
Sets the initial size of the available memory heap for the virtual machine , The default unit is bytes , The size is 1024 And greater than 1MB, You can use k(K) or m(M) To set a large amount of memory in units . The initial heap size is 2MB.
for example :-Xms6400K,-Xms256M
【3.2】-Xmx
Set the maximum available size of the virtual machine memory heap , The default unit is bytes . The value must be 1024 An integral multiple , And it's bigger than 2MB. You can use k(K) or m(M) To set a large amount of memory in units . The default heap maximum is 64MB.
for example :-Xmx81920K,-Xmx80M
【3.3】-Xloggc:
Write the information of each garbage collection of the virtual machine to the log file , The file name is from file Appoint , The file format is flat file , Content and -verbose:gc The output is the same .
【3.4】-client,-server
These two parameters are used to set the running mode of the virtual machine ,client Mode starts faster , But runtime performance and memory management are not as efficient as server Pattern , Usually used for client applications . contrary ,server Mode startup is better than client slow , But higher performance can be achieved .
Add : And client Compared to model , server Patterns do more compiler optimization , Such as instruction reordering ;
Summary :
stay windows On , The default virtual machine type is client Pattern ;
If you want to use server Pattern , It needs to be added when starting the virtual machine -server Parameters , For better performance , Apply to the server side , Recommend server Pattern , Especially more than one CPU The system of , Higher performance achieved . stay Linux,Solaris By default server Pattern .
边栏推荐
- Part 63 - interpreter and compiler adaptation (II)
- Week 12 - task 2- shoulder to shoulder cadres
- What if the hard disk fails to recognize how to recover data
- Go compile source code (window environment)
- Why Houdini made the pyside2 plug-in crash
- AIRNET notes 1
- Rearrangement string of leetcode simple question
- What are the uses of wireless pressure collectors?
- Convert data frame with date column to timeseries
- 64 commonly used terms for data analysis, really all!
猜你喜欢

2-nitro-5,10,15,20-tetra (4-methylphenyl) porphyrin copper (no2tmpp) Cu) /2-nitro-5,10,15,20-tetra (4-methylphenyl) porphyrin (no2tmpp) H2) Qiyue porphyrin supply

2022 recommended high-speed rail industry research report investment strategy industry development prospect market analysis (the attachment is a link to the online disk, and the report is continuously

Maximum ascending subarray sum of leetcode simple problem

Research Report on recommended specialized, special and new industries in 2022 industry development prospect and market investment analysis (the attachment is a link to the online disk, and the report

Design risc-v processor from scratch -- data adventure of five stage pipeline

JIRA basic usage sharing

Meta metauniverse female safety problems occur frequently. How to solve the relevant problems in the metauniverse?

ES6 Modularization: export /import

Fault: NetBt log for id4321

2022 recommended cloud computing industry research report investment strategy industry development prospect market analysis (the attachment is a link to the online disk, and the report is continuously
随机推荐
Design and practice of kubernetes cluster and application monitoring scheme
Quickly write MVVM code using source generators
String and variable are spliced into variable name
The win11 file resource manager has an explicit Caton, and Microsoft promises to improve the performance in 2022
Week 10 - task 1- fill in the blank: line class inherits point class
Hyperledger Fabric 2. X custom smart contract
Establishing the development environment of esp8266
MySQL add / delete / modify query SQL statement exercise yyds dry goods inventory
How to combine two byte arrays [repeat] - how to combine two byte arrays [duplicate]
Difference between parametric continuity and geometric continuity
What has urbanization brought to our mental health and behavior?
Common methods for describing 3D models of objects and their advantages and disadvantages
CCTV revealed that xumengtao won the black Technology: there was a virtual coach???
Are there too many programmers in China at present?
2022.02.14
[chromium] win10 vs2019 environment chromium configuration and compilation.
2,5-di (3,4-dicarboxyphenoxy) - 4 '- phenylethynylbiphenyldianhydride (pephqda) / Qiyue custom supply porphyrin modified amphiphilic block copolymer peg113-pcl46-porphyrin
How to insert pseudo code into word documents simply and quickly?
The most complete machine learning model training process
Difference between URI and URL