HERE , 作者是说
3) String pool is created in PermGen area of Heap, garbage collection can occur in perm space but depends upon JVM to JVM. By the way from JDK 1.7 update, String pool is moved to heap area where objects are created.
这样做有什么具体原因吗?我无法在网上找到任何内容。这意味着什么?
最佳答案
迁移到元空间是必要的,因为 PermGen 真的很难调整。
此外,很难确定 PermGen 的大小,因为大小取决于很多因素,例如类的总数、常量池的大小、方法的大小等。
此外,HotSpot 中的每个垃圾收集器都需要专门的代码来处理 PermGen 中的元数据。从 PermGen 中分离元数据不仅允许无缝管理元空间,而且还允许进行改进,例如简化完整垃圾收集和类元数据的 future 并发解除分配。
关于java - String pool创建在Heap的PermGen区或Object区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28107739/