How to increase ShortCache high value in Java

39 Views Asked by At

The following options set the high value for IntegerCache in Java:

-XX:AutoBoxCacheMax=42000 -Djava.lang.Integer.IntegerCache.high=21000

But the following doesn't seem to work

-Djava.lang.Short.ShortCache.high=21000

I checked it in the memory profiler, and multiple Short instances are allocated for the same numeric value.

So how to set the high value for ShortCache in Java, if it's possible?

0

There are 0 best solutions below