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
11
votes
1 answer

How to debug the openjdk9 by netbeans8.2 in win10?

When I tried to debug the openjdk9 by netbeans8.2 in win10, I got the following error: "\"D:/jdk9/jdk9/build/windows-x86_64-normal-server-fastdebug/jdk/bin/java.exe\": not in executable format: File format not recognized" How can I fix it? I …
YuFeng Shen
  • 1,475
  • 1
  • 17
  • 41
11
votes
2 answers

Bounds Checking in Java

"Hotspot can remove bounds checking in Java." Can any one explain this please? Actually im analysing the differences between C++ and Java. It is not a homework and im analysing on my own interest.
11
votes
3 answers

Why is Java faster if it repeats the same code?

Given the following code: public class Test{ static int[] big = new int [10000]; public static void main(String[] args){ long time; for (int i = 0; i < 16; i++){ time = System.nanoTime(); …
Alduno
  • 307
  • 2
  • 9
11
votes
2 answers

Determining whether a particular JDK Method typically has an intrinsic implementation

Short of the reading the OpenJDK source code (which I'm not averse to) is there a reasonably comprehensive (or 'official') list of intrinsic operations within the Hotspot JVM (say for Intel)? For example, what's the quickest way to determine whether…
Donald_W
  • 1,773
  • 21
  • 35
11
votes
1 answer

What is a de-reflection optimization in HotSpot JIT and how does it implemented?

Watching Towards a Universal VM presentation, I studied this slide, which lists all the optimisations that HotSpot JIT does: In the language-specific techniques section there is a de-reflection. I tried to find some information about it accross the…
MainstreamDeveloper00
  • 8,436
  • 15
  • 56
  • 102
11
votes
4 answers

What is current status of Oracle Java HotSpot VM performance options (+UseStringCache, +UseCompressedStrings, +OptimizeStringConcat)

I was reading Java HotSpot VM Options. I've seen some interesting VM switches, mostly pertaining to Strings - which is of great value to me since my app is doing some heavy String manipulation. Those…
Rade_303
  • 905
  • 11
  • 28
11
votes
3 answers

Which Java HotSpot JIT compiler is running?

I would like to know if my no VM argument invocation of HotSpot Java is running with -client, -server, or tiered compilation options. When I supply no VM arguments, which one is chosen by default? Is there a way to output diagnostics about which JIT…
Julien Chastang
  • 17,592
  • 12
  • 63
  • 89
11
votes
1 answer

Why java.lang.Object.getClass() (and reflection) is slower than usual?

We are encountering some strange JVM performance issues. We have a large and somewhat opaque GUI component (Actuate Formula 1 spreadsheet). If we initialize all of it from the Event Dispatch Thread (as you should), we find that the code runs…
Paul Hollingsworth
  • 13,124
  • 12
  • 51
  • 68
10
votes
2 answers

Is memory allocation on the JVM lockless

When you do a new Object() in Java, does the jvm use a lockless algorithm to allocate memory or does it need to lock? The JVM I am referring to in this case is the Hotspot VM. From the little I know about it, it just needs to increment a pointer to…
pdeva
  • 43,605
  • 46
  • 133
  • 171
10
votes
1 answer

What is the Java libjli library for?

I am using JNI to allow C code to offload some work best done in Java. In this question I was trying to link the libjvm and libjli libraries for my code to work, but now I'm questioning whether I even need the JLI library. I cannot find any…
Neal
  • 137
  • 1
  • 7
10
votes
1 answer

What causes a method to be classed as "'not compilable (disabled)" by the hotspot compiler?

After making some changes to an application it suffered a significant performance degradation and on investigation one of the most frequently called methods is no longer being compiled. Turning on: -XX:+LogCompilation shows that before the change,…
10
votes
1 answer

Are objects prefetched from an array of references in Java?

Imagine that we have a 1000 objects of the same type scattered across the memory (they were created at different times and other objects have been created in between). We have an array which holds references to each of the 1000 objects. Question If…
PaperTsar
  • 961
  • 1
  • 9
  • 22
10
votes
2 answers

Value integrity guarantee for concurrent long writes in 64-bit OpenJDK 7/8

Note: this question isn't related to volatile, AtomicLong, or any perceived deficiency in the described use case. The property I am trying to prove or rule out is as follows: Given the following: a recent 64-bit OpenJDK 7/8 (preferably 7, but 8…
nadavwr
  • 1,820
  • 16
  • 20
10
votes
2 answers

bootstrap class path not set in conjunction with -source 1.6

I am upgrading my application from java 1.6 to 1.7. When I try to build using Maven 3.2.1, my build fails with below error msg: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project…
EmeraldTablet
  • 812
  • 3
  • 12
  • 30
10
votes
5 answers

Do most JVMs allocate memory for unused methods?

Say we have the following classes: class DoubleOhSeven { public static void doSomethingClassy(); public static void neverDoThisClassy(); } class Dude { public void doSomething(); public void neverDoThis(); } public class Party { public…
fny
  • 31,255
  • 16
  • 96
  • 127