Accessibility Analysis of Object Survival Algorithm from JVM Zero Foundation to Advanced Combat

Accessibility Analysis of Object Survival Algorithm from JVM Zero Foundation to Advanced Combat

Accessibility Analysis of Object Survival Algorithm from JVM Zero Foundation to Advanced Combat



foreword

Accessibility Analysis of Object Survival Algorithm from JVM Zero Foundation to Advanced Combat


Reachability Analysis Algorithm

The reachability analysis algorithm is introduced from graph theory in discrete mathematics. The program regards all reference relationships as a graph, starts from a node GC ROOT, and searches for the corresponding reference node. After finding this node, continue to search for this node reference nodes, when all the reference nodes are found, the remaining nodes are considered as unreferenced nodes, that is, useless nodes

  • The objects that can be used as GC Root in java are

    • Objects referenced in the virtual machine stack (local variable table)

    • Objects referenced in the native method stack

    • Objects referenced by static properties in the method area

    • Objects referenced by constants in the method area


Summarize

This article introduces the entire content of the accessibility analysis of the object survival algorithm from the JVM zero foundation to the advanced actual combat. I will continue to update it in the future. If you like it, please click to follow. The JVM series will continue to be updated.

Guess you like

Origin blog.csdn.net/weixin_42397937/article/details/131685884