10

What is the difference between HashMap in alt-rt.jar and rt.jar. I think I see a considerable speed up in one of my applications, what would be the explanation?

Best Regards

P.S.: I found the two different *.jar in JDK 1.6.0_25 64-bit. Eventually the speed up is also related to alt-string.jar. This alt could eventually be related to a command line option:

http://thevirtualmachinist.blogspot.com/2010/09/xxusecompressedstrings.html

But I am more interested in understanding alt-rt.jar and I don't see from the above article that there is a command line option related to it.

1 Answers1

5

alt-rt.jar is used only when AggressiveOpts JVM option is enabled. Indeed the HashMap from alt-rt.jar is faster than the traditional HashMap, however its memory consumption is much higher due to usage of HashMap$FrontCache.

Be careful when using AggressiveOpts parameter in production, we had a lot of trouble with it in memory limited setups. There could be other pitfalls hiding.

Artiom Gourevitch
  • 786
  • 1
  • 11
  • 22
  • Does AggressiveOpts influence the class path? Since alt-rt.jar is in the class path, I have doubts that the AggressiveOpts can influence the use of the faster HashMap. Although I don't doubt that AggressiveOpts has some influence, see also: http://stackoverflow.com/questions/2959878/what-flags-are-enabled-by-xxaggressiveopts-on-sun-jre-1-6u20 –  Nov 23 '12 at 11:02