当前位置:网站首页>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 .
边栏推荐
- Fault: display Storport driver out of date in component health
- What are the uses of wireless pressure collectors?
- Week 10 - task 0- execution process instance resolution of constructors and destructors
- Conditional test, if and case conditional test statements of shell script
- 51 single chip microcomputer learning notes 7 -- Ultrasonic Ranging
- Skills of writing test cases efficiently
- Alphacode made its debut! The programming version of "Alpha dog" competed quietly and defeated half of the programmers
- ES6 Modularization: export /import
- DANGER! V** caught climbing over the wall!
- Agile invincible event
猜你喜欢

2022 recommended quantum industry research industry development planning prospect investment market analysis report (the attachment is a link to the online disk, and the report is continuously updated

Why can't the article be posted?

Hyperledger Fabric 2. X custom smart contract

It turns out that the joys and sorrows of programmers are not interlinked

Ctrip launched the "3+2" office mode. Are you sour?

Modularization and modular specification commonjs

What has urbanization brought to our mental health and behavior?

Rich material libraries make modeling easy and efficient for developers

Testing grpc service with grpcui

Segment in Lucene
随机推荐
QT writing map comprehensive application 58 compatible with multi browser kernel
Pytest (7) -yield and termination function
2022.02.14
Loosely matched jest A value in tohavebeencalledwith - loose match one value in jest toHaveBeenCalledWith
Use of sed in shell script
Call the computer calculator and use it to convert several base numbers
Servlet version conflict causes page 404
DANGER! V** caught climbing over the wall!
Fresnel diffraction with rectangular aperture based on MATLAB
ICLR is going to have a big discussion on the deep generation model. Max welling and the winner of the AAAI million dollar award are here. Bengio is one of the organizers
Fault: KDC warning log for id29
What is the "danksharding" of V God Kop on Valentine's day?
Analysis report on the investment market of the development planning prospect of the recommended rare earth industry research industry in 2022 (the attachment is a link to the online disk, and the rep
Analysis report on the investment market of the development planning prospect of the recommended wind power industry research industry in 2022 (the attachment is a link to the network disk, and the re
Boost the digital economy and face the future office | the launch of the new version of spreadjsv15.0 is about to begin
Why is there a packaging type?
Venn diagram proportional and color shading with semi transparency
How to combine two byte arrays [repeat] - how to combine two byte arrays [duplicate]
Haar cascades and LBP cascades in face detection [closed] - Haar cascades vs. LBP cascades in face detection [closed]
Leetcode simple question: judging the color of a grid on a chess board