Java GC safepoint

前端 未结 2 702
天涯浪人
天涯浪人 2020-12-01 14:19

When a garbage collector freezes the application threads before cleaning up unreferenced objects, all threads are required to be at a \"safepoint\" in their execution. I fou

2条回答
  •  心在旅途
    2020-12-01 14:28

    Unfortunately this is a poor defined field. The JVM places safepoints when it decides to, but there is no specifications to when. One version/update to the next of Java can be different. There are some cases like Unsafe.copyMemory() which doesn't have a safepoint, but you cannot be sure where safepoints will be placed.

提交回复
热议问题