In-depth understanding of jvm study notes 1

1: Use %java_home/bin/jvisualvm.exe to monitor the running of the virtual machine.

Plugins can be installed in Tools--Plugins.

2: Generate, browse and dump snapshots

There are summary information (system information, thread stack information), class, instance and other information.

Among them: System Information System.getProperties()

catalina.base=E:\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
catalina.home=E:\apatche-tomcat-7.0.61

 

file.encoding=UTF-8
file.separator=\

 

 java.home=C:\Program Files\Java\jre7
 java.io.tmpdir=C:\Users\WANGYU~1\AppData\Local\Temp\

 

line.separator=\r\n

sun.jnu.encoding=GBK

 

3: JVM cannot see some abnormal stacktrace problems

JAVA_OPTS , as the name suggests, is a variable used to set JVM-related operating parameters.
-XX:-OmitStackTraceInFastThrow (+OmitStackTraceInFastThrow )

      -server -XX:+OmitStackTraceInFastThrow TestCompile

 

4: The difference between catalina.base and catalina.home

These two properties are only used when you need to install multiple Tomcat instances and do not want to install multiple software backups, which saves disk space.

catalina.home (installation directory): points to the location of public information, which is the parent directory of bin and lib.
catalina.base (working directory): Points to the location of private information for each Tomcat directory, which is the parent directory of conf, logs, temp, webapps, and work.

 

sun.jnu.encoding file.encoding difference

When creating a file: preferred

ZipFile zf = new ZipFile(zipFilePath+path+".zip",System.getProperty("sun.jnu.encoding"));

[You can also get the file before creating the file in the case of a clear format: System.setProperty("sun.jnu.encoding","utf-8")]

Conclusion through problem solving: sun.jnu.encoding affects the creation of file names, while file.encoding affects file content.
Therefore, when we use Java to process Chinese files, if we find that the Chinese content of the file is not garbled, but the Chinese name of the file is garbled, we should think more about the difference between sun.jnu.encoding and file.encoding.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327071384&siteId=291194637