how to understand this floating garbage? Wasn"t it discovered and cleaned up during this GC relabeling of remark? Why wait until the next time GC can clean up?
how to understand this floating garbage? Wasn"t it discovered and cleaned up during this GC relabeling of remark? Why wait until the next time GC can clean up?
re-mark (Remark) the function is:
before the concurrent tag, because the GC and the user program are executed concurrently, it may cause part of the object that has been marked as unreachable from the GC Roots , because the user program (concurrency) runs, can reach , and the function of Remark is to mark this part of the object as reachable object .
as for "floating garbage", because CMS is concurrent when marks , the GC thread and the user thread execute concurrently. Of course, this process may cause the newly generated garbage (that is, floating garbage) not to be marked because of the alternate execution of threads. On the other hand, the function of remarking is only to modify the unreachable objects obtained by the previous concurrent tag , so there is no way to deal with "floating garbage".
The remark process marks the living object, judging from the reachability of the GCRoot that the object is alive, but cannot mark the "dead" object.
if the remark process is marked alive during the initial marking phase and "dies" during the concurrent run, the remark process cannot be corrected, so it becomes floating garbage and needs to wait for the next gc to arrive.
Thank you for the invitation. Just talk about your understanding:
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...
I want to dump all the classes loaded by the virtual machine through the ClassDump in sa-jdi.jar. ClassDump supports dump classes from jvm processes or jvm core dump. for online applications, you should not dump, pid directly if you want to get a co...
jvm has its own gc strategy, so what s the point of using System.gc ()? ...