so, after asking this question, became clear important question not "how can i", "should i"?
we have customers moving java7 java8 (using tomcat7). java7 required setting maxpermsize, and customers have increased max above default set installer due individual needs , uses.
should i set --xx:maxmetaspacesize (to previous -xx:maxpermsize setting) customers have defined custom max? new installs? should set --xx:maxmetaspacesize @ all?
what pros , cons of such decision?
as commented on previous answer reasons setting limit on memory pools different.
if users increased maxpermsize above default either avoid full gcs / concurrent mode failures cms or because applications genuinely needed lot of perm gen space.
decreasing the metaspace limit infinite default serve entirely different purpose: avoiding unbounded metaspace growth.
the thing that's upper limit. committed, i.e. current metaspace size smaller. in fact, there setting called maxmetaspacefreeratio (default 70%) means actual metaspace size never exceed 230% of occupancy.
and grow first have fill up, forcing garbage collection (metaspace full) in attempt free objects , when cannot meet minmetaspacefreeratio (default 40%) goal expand current metaspace no more 230% of occupancy after gc cycle.
so in practice actual metaspace size should stabilize within band close relative actual need unless application continuously leaking classloaders/classes or generating enormous amount of dynamic code.
tl;dr: there may reasons restrict metaspace size, different original reasons setting perm gen sizes. therefore need should re-evaluated.
Comments
Post a Comment