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
16
votes
4 answers

Java is scaling much worse than C# over many cores?

I am testing spawning off many threads running the same function on a 32 core server for Java and C#. I run the application with 1000 iterations of the function, which is batched across either 1,2,4,8, 16 or 32 threads using a threadpool. At 1, 2,…
intrigued_66
  • 16,082
  • 51
  • 118
  • 189
15
votes
1 answer

How to get jmap histogram programmatically?

I would like to get the equivalent of the ouput of jmap -histo programmatically, from inside the monitored application. I see triggering a heap dump is possible through the HotSpot diagnostic bean, but I can't see how to get the histogram data. Is…
nicoulaj
  • 3,463
  • 4
  • 27
  • 32
15
votes
2 answers

unexplained 10%+ performance boost from simply adding a method argument (slimmer jit code)

(note: proper answer must go beyond reproduction). After millions of invocations, quicksort1 is definitely faster than quicksort2, which have identical code aside from this 1 extra arg. The code is at the end of the post. Spoiler: I also found the…
user2023577
  • 1,752
  • 1
  • 12
  • 23
15
votes
1 answer

Understanding internal fragmentation properties of Hotspot JVM process

For both on-heap and off-heap allocations. On-heap - in the context of three major garbage collectors: CMS, Parallel Old and and G1. What I know (or think that I know) to the moment: all object (on-heap) allocations are rounded up to 8 bytes…
15
votes
1 answer

IntelliJ Idea tomcat Hot swap failed: schema change not implemented Operation not supported by VM

I got this error when I try to reload class (hot swap) with changed method bodies in my project. Before everything works fine, but suddenly it stop and I don't remember nothing what could be a cause. What is strange I have another project with the…
biesczadka
  • 571
  • 1
  • 7
  • 19
15
votes
1 answer

What are the differences in JIT between Java and .Net

I know Microsoft .NET uses the CLR as a JIT compiler while Java has the Hotspot. What Are the differences between them?
Eyad Salah
  • 1,084
  • 1
  • 11
  • 22
15
votes
1 answer

Java fatal error SIGSEGV with no added native code

I am getting an error message from the Java compiler that I don't understand. I've tested my code on OSX 10.6, 10.9, and Ubuntu 14.04, with both Java 6 and 7. When I run with the Eclipse debugger or from the interpreter (using -Xint option),…
jackkamm
  • 541
  • 1
  • 4
  • 11
15
votes
2 answers

HotSpot JIT inlining strategy: top-down or down-top

Suppose we have 3 methods: method 2 is called from method 1, method 3 is called from method 2. Methods 2 and 3 are of size 30 bytecodes each. Also, suppose for definiteness method 2 is always called from method 1 exactly once, and method 3 is always…
leventov
  • 14,760
  • 11
  • 69
  • 98
15
votes
4 answers

Invalid access of stack red zone from Java VM

I'm trying to figure out what can cause this error in Java: Invalid access of stack red zone 0x115ee0ed0 rip=0x114973900 Has anyone ever encountered this error message? It's literally killing the JVM and everything stops there. I'm currently using…
Malaxeur
  • 5,973
  • 1
  • 36
  • 34
14
votes
1 answer

Unexpected VarHandle performance (4X slower than alternatives)

In JEP193, one of the specific goals of VarHandles is to provide an alternative to of using FieldUpdaters and AtomicIntegers (and avoid some of the overhead associated with them). AtomicIntegers can be particularly wasteful in terms of memory since…
juancn
  • 2,483
  • 2
  • 20
  • 25
14
votes
5 answers

Why I can't create an array with large size?

Why it is impossible to create an array with max int size? int i = 2147483647; int[] array = new int[i]; I found this explanation: Java arrays are accessed via 32-bit ints, resulting in a maximum theoretical array size of 2147483647 elements. But…
JohnWinter
  • 1,003
  • 5
  • 12
  • 25
14
votes
2 answers

execute new java code in existing jvm process

I have a java process currently running under a windows shell. One of the threads responsible for serialisation is blocked indefinitely and as a result important information which is stored in memory is no longer being written to disk. If I shutdown…
pstanton
  • 35,033
  • 24
  • 126
  • 168
14
votes
2 answers

Exact state of committed memory in java

Im curious what the exact meaning of "committed" memory is when the value is queried from the MemoryUsage class. That class explains it as "committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java…
Spencer Stejskal
  • 498
  • 1
  • 6
  • 15
14
votes
5 answers

JRE 32bit vs 64bit

I've been using Java for a while now, and my typical ritual of setting up a new dev machine requires the norm of downloading and installing the latest JDK from Oracle's site. This prompted an unusual question today, does it matter if I use the…
SnakeDoc
  • 13,611
  • 17
  • 65
  • 97
14
votes
1 answer

Where is object's hash code stored if biased-locking is enabled in HotSpot JVM?

As far as I know an object's hash code is normally stored in the header word of the object, which, for example, may have the following layout in HotSpot: | hash code | age | 0 | 01 | According to the HotSpotInternals - Synchronization with biased…
digger
  • 233
  • 1
  • 8