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
43
votes
2 answers

How does the JVM decided to JIT-compile a method (categorize a method as "hot")?

I already worked with -XX:+PrintCompilation, and I know the basic techniques of the JIT-compiler and why JIT-compilation is used. Yet I still have not found out how the JVM decides to JIT-compile a method, i.e. "when the right time has come to…
Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
41
votes
4 answers

How can I code Java to allow SSE use and bounds-check elimination (or other advanced optimizations)?

The Situation: I'm optimizing a pure-java implementation of the LZF compression algorithm, which involves a lot of byte[] access and basic int mathematics for hashing and comparison. Performance really matters, because the goal of the compression…
BobMcGee
  • 19,824
  • 10
  • 45
  • 57
34
votes
2 answers

Java VM tuning - Xbatch and -Xcomp

I am looking at the JVM configuration options for running Alfresco, mainly this document on the Alfresco Wiki. One of the recommendations is to use the JVM flags -Xcomp and -Xbatch. The justification of this is: If you wish to have Hotspot…
Rich
  • 15,602
  • 15
  • 79
  • 126
33
votes
1 answer

Useless test instruction?

I got the below assembly list as result for JIT compilation for my java program. mov 0x14(%rsp),%r10d inc %r10d mov 0x1c(%rsp),%r8d inc %r8d test %eax,(%r11) ; <--- this instruction mov …
QIvan
  • 652
  • 4
  • 13
33
votes
1 answer

Complete list of JVM options

Besides official documentation I have found only this post. But it is quite old and incomplete (only -XX options available). For example, I couldn't find -XX:AutoBoxCacheMax option in none of them. Where the complete list can be found if it exists?
Nolequen
  • 3,032
  • 6
  • 36
  • 55
33
votes
2 answers

AES-NI intrinsics enabled by default?

Oracle has this to say about Java 8 with regards to AES-NI: Hardware intrinsics were added to use Advanced Encryption Standard (AES). The UseAES and UseAESIntrinsics flags are available to enable the hardware-based AES intrinsics for Intel…
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
32
votes
1 answer

How do i know which default settings are enabled for Sun JVM?

i want to try CompressedOops on my JVM. No I wonder if it might be enabled by default. I run this jvm on debian/squeeze: $ java -version java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM…
Janning Vygen
  • 8,877
  • 9
  • 71
  • 102
32
votes
2 answers

Java 8 reserves minimum 1G for Metaspace despite (Max)MetaspaceSize

Java 8 reserves 1G for Metaspace just after it starts. It means that minimum metaspace size is 1G. But I set up MetaspaceSize to 300m and MaxMetaspaceSize to 400m. Why Java reserves more then I allow? Java Version $ java -version java version…
Eugene To
  • 1,890
  • 2
  • 19
  • 30
28
votes
2 answers

Why does Java , running in -server mode, say that the version is "mixed-mode"?

Why does Java , running in -server mode, say that the version is "mixed-mode" ? When I see that, does it mean that the JVM didn't truly load in pure server mode?
djangofan
  • 28,471
  • 61
  • 196
  • 289
28
votes
2 answers

OpenJDK vs Java HotspotVM

Are OpenJDK VM and Oracle Hotspot VM still two different JVMs? I can't seem to find any somewhat official documentation on anything about OpenJDK VM. Even in OpenJDK homepage there is an HotSpot Group which develops HotSpot VM. The HotSpot group is…
arvist
  • 424
  • 1
  • 5
  • 9
28
votes
3 answers

How is ArrayOutOfBoundsException possible in String.valueOf(int)?

Why does this code sometimes produce ArrayOutOfBoundsException? How is that even possible for String.valueOf(int)? public static String ipToString(ByteString bs) { if (bs == null || bs.isEmpty()) { return null; } else { StringBuilder sb…
ʞɔıu
  • 47,148
  • 35
  • 106
  • 149
28
votes
2 answers

Advanced Code Hot Swapping in JDK 8?

I am looking for better HotSwapping in the JavaVM. Being able to only apply method body changes is okay but quite limiting. The options available is JRebel and a discontinued project called Dynamic Code Evolution Virtual Machine (DCEVM). There is a…
Martin Kersten
  • 5,127
  • 8
  • 46
  • 77
25
votes
2 answers

How do I programmatically find out my PermGen space usage?

I'm trying to diagnose a java.lang.OutOfMemoryError: PermGen Space error when running on Sun's Hotspot JVM, and would like to know how much PermGen space my program is using at various points. Is there a way of finding out this information…
Simon Nickerson
  • 42,159
  • 20
  • 102
  • 127
24
votes
3 answers

Difference between GraalVM and Jvm-Hotspot

Can someone explain the differences between GraalVM and Jvm-Hotspot, and how GraalVM is related to OpenJDK's HotSpot.
Mahesh Pujari
  • 493
  • 1
  • 9
  • 15
24
votes
1 answer

JVM 8 exit code -559038737 (0xDEADBEEF)

My application has started to non-deterministically fail after upgrading to Java 8. It doesn't throw an exception or print an error message. The only sign of its failure is the exit code -559038737. Has anyone encountered this?
Aleksandr Dubinsky
  • 22,436
  • 15
  • 82
  • 99
1
2
3
46 47