简体   繁体   中英

How to estimate java permgen size required?

How can I estimate the permgen space requirement for a java application? I am not looking to minimize the permgen space requirement for the code that I write, but given the size of the jars of my own code and that of the 3rd parties, how do I get a reasonable estimate of the permgen size that will be required for running the program?

PermGen space is reserved for long-term objects, those objects who has survived young garbage collections.

It is quite difficult to know how much space do you need. I think the best you can do is to use JConsole or VisualVM (or whatever) to profile your applications under several possible scenarios.

This way you can get an idea on how much permgen space do you need, but don't calculate an average, use the maximum.

Anyway, I won't use the maximum value, instead I will increase it in any percent, at least 15-20%. But keep in mind, this can be dangerous if you don't estimate over nice scenarios ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM