孙佩尔姆根JRockit 垃圾收集

发布于 2024-08-28 13:31:26 字数 115 浏览 3 评论 0原文

在Sun JVM 中,由类加载器加载的类被放置在permgen 空间中并且永远不会被gc'd。 (除非类加载器超出范围)据我所知,JRockit 将相同的数据放在堆上。该数据是否会被垃圾收集?

谢谢。

In the Sun JVM, classes that are loaded by the class loader are put in permgen space and never gc'd. (Unless the class loader goes out of scope) It's my understanding that JRockit puts that same data on the heap instead. Is that data then subject to garbage collection?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫腻 2024-09-04 13:31:26

这个问题与类的分配位置无关。问题是类加载器总是保留对其类的引用,这意味着类不能被垃圾回收,除非并且直到它们的类加载器被垃圾回收为止。

这个问题在 HotSpot 上更加明显,因为 PermGen 内存稀缺且昂贵。

The problem has nothing to do with where the classes get allocated. The problem is that classloaders always keep references to their classes, which means that classes cannot be garbage collected unless and until their classloader gets garbage collected.

This problem is just more obvious on HotSpot, because PermGen memory is scarce and expensive.

温折酒 2024-09-04 13:31:26

另一个值得注意的点是,Sun 中的 PermGen 经常被耗尽,而其他 JVM 可能会在另一个不那么有限的空间中进行分配。

Another salient point though is that PermGen is often exhausted in Sun's whereby other JVMs may allocate in another not-so-limited space.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文