JVM - Are WeakReferences collected in minor GC?

前端 未结 6 1067
情歌与酒
情歌与酒 2021-01-05 11:06

I was wondering about that since that would make them less useful. If so, is there a way to make memory weakly referenced only \"garbage\" on major GC?

6条回答
  •  情话喂你
    2021-01-05 11:16

    Some insights from Brian Goetz (article from 2006) that still seems in viguor:

    Weak References

    Soft References -> interesting details in the [A poor man's cache] and [How the garbage collector handles References] paragraphs.

提交回复
热议问题