for example, if the machine full gc seven or eight times at regular intervals in an afternoon, how to start to query the problem? I feel that I can"t see anything when I look at the jstack log. Mengxin asks for help.
for example, if the machine full gc seven or eight times at regular intervals in an afternoon, how to start to query the problem? I feel that I can"t see anything when I look at the jstack log. Mengxin asks for help.
1. Save thread stack: jstack-l pid > jstack.log
2, save heap:jmap-dump:format=b,file=heap.hprof pid
3, use mat to analyze heap, to see if there are memory leaks
4, analyze gc log (if gc log, is not opened before, then reopen it, and then check it with gc log) to see if the gc parameter configuration is not appropriate
add the parameter to enable gclog
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintTenuringDistribution
-Xloggc:/some-path/gc-$(date +%Y%m%d-%H%M%S).log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=10M
-Xlog:gc*=info:file=/some-path/gc-%t-%p.log:timemillis,pid:filecount=5,filesize=10M
jdk8 adds this parameter, but no gc log
is CAS compare and set or compare and sweep, or are these two different things ...
in JAVA, running programs can be managed and monitored through the JMX interface. you can obtain the program GC through the open function of JMX, as follows: public class TestJMX { public static void main(String[] args) { List<GarbageC...
see a paragraph: < H2 > before Minor GC occurs, the virtual machine checks whether the largest contiguous space available in the old era is larger than the total space of all objects in the new generation. If this condition is true, then Minor GC can e...
https: www.cnblogs.com ggjuc. this article says: < H2 > 1 CMS will not defragment the heap, so in order to prevent full gc, from causing heap fragmentation, merge the fragments by opening the CMS phase: < H2 > does this mean that after CMS full g...
< H2 > the book says: during the concurrent cleanup phase, the user thread is still running, and new garbage may be generated during this period. New garbage cannot be removed this time GC, but can only be cleaned up next time. These rubbish have a profe...
Why can t JVM tuning be automated? ...
Java71-:"";""...
import java.io.IOException; import java.util.Properties; public class PropertyUtil { public static void main(String[] args) { Properties properties = new Properties(); try { properties.load(PropertyUtil.class.getClassLoade...
in working memory, there are method stack frames and registers. Pc, is understandable, but why should some referenced main memory variables be copied to working memory? I don t think it s necessary at all, which leads to cache consistency problems. Or...
< H2 > the main method executes an exception and does not exit the program all the time < H2 > A RuntimeException,Spring container startup interrupt is thrown in the static code block of the class, but the program has not been terminated. I don t kn...
ladies and gentlemen, I have encountered a problem when using G1. The termination phase of G1 takes more than 90% of the total young gc, which is generally about 100ms, which leads to the failure of the whole program. GC log is as follows: 2018-05-16T...
console shows that ChildClass has been loaded, why not output c init ...
in most cases in JAVA, objects are allocated in Eden by default, and when GC is triggered, if there is not enough space in survivor, it will be put into the old age. suppose the following scenario: eden:80M survivor1:10M survivor2:10M now survivor2 is...
Let s not talk about the principle of the train algorithm here. the train algorithm is the gc algorithm used by the G1 collector D _ C are three objects that need to be called to each other. There are no other citations. But when the algorithm sc...
the program first executes a start method to take up a lot of memory, and then executes endEmpty to call System.gc () to run, the task manager can see that the memory footprint of the program immediately reaches 4G, but the memory footprint of th...
ask two questions: is there any difference in jvm execution between using fully qualified names and using import, except for the difference in length? If there is a difference, which is more efficient? use the class name. What is the difference in ...
The code is as follows: package referenceCoutingGC; ** * * testGC()ogjAogjBGC * * public class referenceCoutingGC { public Object instance = null; private static final int _1MB = 1024*1024; private byte[] bigSize = ...
Why does JAVA have multiple loaders I know that the function of the loader is to get the binary byte stream through the class name. It is mainly divided into four kinds of loaders: startup class-> extension class-> application class-> custom class. I al...
for example, the member variable of a class: Object obj = new Object(); obj is an instance of an object. In a broad sense, it is stored on the "stack " and points to the memory address on the "heap ". Specifically, I have the impression that obj sho...
in the process of learning Java, there are some problems that you need to use Java disassembly tool javap to view bytecode instructions, but there are some problems when viewing bytecode instructions, assuming the following simple code, public static v...