Interned strings not in permgen?

后端 未结 1 1245
無奈伤痛
無奈伤痛 2020-12-17 11:02

I\'ve run the jmap -heap command on our running Java application and here\'s what I got:

C:\\Program Files\\Java\\jdk1.7.0_05\\bin>jmap -

相关标签:
1条回答
  • 2020-12-17 11:29

    From Java 7 release notes:

    In JDK 7, interned strings are no longer allocated in the permanent generation of the Java heap, but are instead allocated in the main part of the Java heap (known as the young and old generations), along with the other objects created by the application. This change will result in more data residing in the main Java heap, and less data in the permanent generation, and thus may require heap sizes to be adjusted. Most applications will see only relatively small differences in heap usage due to this change, but larger applications that load many classes or make heavy use of the String.intern() method will see more significant differences.

    0 讨论(0)
提交回复
热议问题