Questions tagged [jvm-hotspot]

HotSpot is the standard Java virtual machine used by both the Oracle and OpenJDK Java runtime environments.

HotSpot is the standard Java virtual machine used by both the Oracle and OpenJDK Java runtime environments for Java SE and EE environments.

This makes it the most widely deployed Java virtual machine in the world.

It is capable of running code from any language which can emit a Java .class file, as well as interpreted languages (e.g. JRuby) which have implemented their interpreters in Java (or another JVM language).

As of 2012, there are at least 200 languages which can run on top of the JVM - including Scala, Groovy, Clojure, JRuby, Jython and many smaller, niche languages.

HotSpot gets its name from the ability to dynamically profile running code and detect the "hot spots" of execution - the most commonly executing methods.

As, under most circumstances, programs spend most of their time in a small percentage of their methods, this focusing of optimization effort on the hot methods is very efficient.

HotSpot compiles and aggressively optimizes these hottest methods to highly platform-specific machine code which is specialized for the exact environment the code is running on.

This ability to use information about the runtime environment (precise instruction sets supported, memory and core configuration, etc) allows HotSpot to perform optimization tricks that are just not possible with a generic ahead-of-time strategy for "i386" or "i686" as is commonly seen in C/C++ environments.

This (along with the JVMs advanced memory management and garbage collection subsystem) makes the performance analysis of HotSpot-hosted programs more difficult compared to well-known techniques for C/C++. Direct comparison between the two environments is difficult - they each have individual strengths, and each has areas where they have definite advantages.

696 questions
971
votes
11 answers

How do I write a correct micro-benchmark in Java?

How do you write (and run) a correct micro-benchmark in Java? I'm looking for some code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/iteration or iterations/time, and why? Related: Is…
John Nilsson
  • 17,001
  • 8
  • 32
  • 42
422
votes
2 answers

Does Java JIT cheat when running JDK code?

I was benchmarking some code, and I could not get it to run as fast as with java.math.BigInteger, even when using the exact same algorithm. So I copied java.math.BigInteger source into my own package and tried this: //import…
Koen Hendrikx
  • 2,243
  • 2
  • 9
  • 7
421
votes
11 answers

Real differences between "java -server" and "java -client"?

Is there any real practical difference between "java -server" and "java -client"? All I can find on Sun's site is a vague "-server starts slower but should run faster". What are the real differences? (Using JDK 1.6.0_07 currently.)
Paul Tomblin
  • 179,021
  • 58
  • 319
  • 408
280
votes
12 answers

Class JavaLaunchHelper is implemented in both ... libinstrument.dylib. One of the two will be used. Which one is undefined

I upgraded to the latest Java 7u40 on MacOS X and started getting the following message on the console when launching my application using Eclipse. The app works fine but I would like to find out the cause of the problem and hopefully a fix for it.…
ams
  • 60,316
  • 68
  • 200
  • 288
218
votes
5 answers

Difference between JVM and HotSpot?

What exactly is HotSpot and how does it relate to JVM and OpenJDK? Is it a library? What exactly does it do? Also, what is the difference between OpenJDK and HotSpot?
Justin
  • 2,225
  • 2
  • 13
  • 8
99
votes
5 answers

Running jmap getting Unable to open socket file

I had to run jmap in order to take heap dump of my process. but jvm returned: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding So I used the…
rayman
  • 20,786
  • 45
  • 148
  • 246
94
votes
4 answers

What are ReservedCodeCacheSize and InitialCodeCacheSize?

Can someone please explain what the JVM option ReservedCodeCacheSize and InitialCodeCacheSize are? Specifically when/why would I want to change it? How do I decide what the right size is? This is what the docs say: -XX:ReservedCodeCacheSize=32m …
Raghu
  • 2,004
  • 1
  • 16
  • 18
90
votes
1 answer

What does the UseCompressedOops JVM flag do and when should I use it?

What does the HotSpot JVM flag -XX:+UseCompressedOops do and when should I use it? What sort of performance and memory-usage differences will I see when using it on a 64-bit Java instance (vs. not using it)?
noahlz
  • 10,202
  • 7
  • 56
  • 75
66
votes
2 answers

What are the differences between JVisualVM and Java Mission Control?

Other than the more 'advanced' GUI from Java mission control, how are they different? At first glance they seem to offer very similar functionality (Interpreting JMX data and Memory/CPU profiling). However, as they are both shipped with the JDK (I'm…
GoldenJam
  • 1,459
  • 1
  • 11
  • 17
53
votes
3 answers

-XX:MaxPermSize with or without -XX:PermSize

We've run into a Java.lang.OutOfMemoryError: PermGen space error and looking at the tomcat JVM params, other than the -Xms and -Xmx params we also specify -XX:MaxPermSize=128m. After a bit of profiling I can see occasionally garbage collection…
dimitrisli
  • 20,895
  • 12
  • 59
  • 63
49
votes
3 answers

JRockit JVM versus HotSpot JVM

If anyone can give me brief information about the advantages and disadvantages of the two JVM since they all depend on the Standard JVM Specification.
Richeve Bebedor
  • 2,138
  • 4
  • 26
  • 40
49
votes
1 answer

JIT not optimizing loop that involves Integer.MAX_VALUE

While writing an answer to another question, I noticed a strange border case for JIT optimization. The following program is not a "Microbenchmark" and not intended to reliably measure an execution time (as pointed out in the answers to the other…
Marco13
  • 53,703
  • 9
  • 80
  • 159
47
votes
2 answers

Read Java JVM startup parameters (eg -Xmx)

I'm trying to figure out if there's a way to determine the JVM startup properties from within a running java process. Specifically I'm trying to find out where parameters such as -Xmx (max heap size) and -XX:MaxPermSize are stored. I'm running…
Bob Albright
  • 2,242
  • 2
  • 25
  • 32
45
votes
4 answers

java PrintCompilation output: what's the meaning of "made not entrant" and "made zombie"

When running a Java 1.6 (1.6.0_03-b05) app I've added the -XX:+PrintCompilation flag. On the output for some methods, in particular some of those that I know are getting called a lot, I see the text made not entrant and made zombie. What do these…
Joe Kearney
  • 7,397
  • 6
  • 34
  • 45
43
votes
3 answers

Default for XX:MaxDirectMemorySize

What is the default value for XX:MaxDirectMemorySize?
Timur Fanshteyn
  • 2,266
  • 2
  • 23
  • 27
1
2 3
46 47