A DESCRIPTION OF THE REQUEST :
This RFE requests users should be able to configure the range of cached values used by the Short.valueOf(short), Integer.valueOf(int) and Long.valueOf(long), including the ability to turn off caching. This would be achieved by the user passing a set of system properties to the JVM when it is started, e.g. :
> java -Djava.lang.Integer.cache=-521..1024 MyApplication
These settings should only be taken as strong hints for tuning purposes and applications should not rely on the fact that specifc values are either cached or not in order to function correctly. Thus if an application requires caching it should implement its own secondary cache. This clause would liberate future releases from the burden of supporting these settings for backward compatability.
JUSTIFICATION :
The current cached range of values for these methods is -128 to 127. While this standard range provides a performance enhancement for most applications, many applications also make heavy use of values outside of this range thus would benefit if they could tune the cache range to their needs. This would go hand in hand with the other currently available JVM parameters used to configure time / space tradeoffs.
The ability to turn off caching would also allow for the setting of a baseline benchmark to compare different settings when tuning an application.
###@###.### 2005-03-11 08:52:23 GMT