Questions tagged [jvm]

The Java Virtual Machine (JVM) enables a set of computer software programs and data structures to use a virtual machine model for the execution of other computer programs and scripts. Use this tag for questions dealing with tools provided by a JVM or how it works in a specific scenario.

The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode. This language conceptually represents the instruction set of a stack-oriented, capability architecture.

A JVM can also execute bytecode compiled from programming languages other than Java. For example, Ada source code can be compiled to execute on a JVM. JVMs can also be released by other companies besides Oracle (the developer of Java), but JVMs using the "Java" trademark may be developed by other companies as long as they adhere to the JVM specification SE 7 published by Oracle and to related contractual obligations.

List of Java and JVM Specifications 6-11

See also "Understanding Oracle Java SE Licensing".

Java was conceived with the concept of WORA - write once, run anywhere. This is done using the Java Virtual Machine (JVM).

The JVM is the environment in which Java programs execute. It is the software that is implemented on non-virtual hardware and on standard operating systems.

JVM is a crucial component of the Java platform, and because JVMs are available for many hardware and software platforms, can be both middleware and a platform in its own right, hence the trademark write once, run anywhere. The use of the same bytecode for all platforms allows Java to be described as "compile once, run anywhere", as opposed to "write once, compile anywhere", which describes cross-platform compiled languages. A JVM also enables such features as automated exception handling, which provides "root-cause" debugging information for every software error (exception), independent of the source code.

A JVM is distributed along with a set of standard class libraries that implement the Java Application Programming Interface (API). Appropriate APIs bundled together form the Java Runtime Environment ().

Online Resources

  1. JVM Wikipedia
  2. A nice online book on the internals of JVM: Inside JVM by Bill Venners
  3. Java HotSpot VM Options
  4. IBM JVM Documentation
  5. OpenJDK Wiki
  6. Oracle HotSpot Wiki - Has information about JVM internals.

What questions should have this tag?

  1. Questions to know how a JVM works in a specific scenario
  2. Questions which deal with tools provided with a JVM
12159 questions
7
votes
5 answers

Shuffling array in multiple threads

I have an array of size N. I want to shuffle its elements in 2 threads (or more). Each thread should work with it's own part of the array. Lets say, the first thread shuffles elements from 0 to K, and the second thread shuffles elements from K to N…
Roman
  • 64,384
  • 92
  • 238
  • 332
7
votes
2 answers

Where is the current version of the Java Virtual Machine Specification?

It would appear as though the only way to get the Java 6 version of the Java Virtual Machine Specification is to take the Second Edition, merge in the Existing Changes and then add on top of that the Java 6 proposed changes which are not really…
David Citron
  • 43,219
  • 21
  • 62
  • 72
7
votes
6 answers

Tools to monitor java thread execution

I've a java web application running on an Tomcat server(Linux). In the production environment I'm facing some performance issue. At random intervals the jsvc process on which tomcat is running starts to run at 90-100% CPU. I'm unable to find out the…
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
7
votes
3 answers

How many JVM we can have in one machine?

I have a class that run infinit (do nothing, just loop and sleep), called NeverReturn. I try to run it using following command in Windows XP 32bit: java -Xms1200M NeverReturn I find with the command I can create only 4 java instance at same time.…
xeranic
  • 1,391
  • 1
  • 9
  • 16
7
votes
2 answers

What does the code comment 'HD, Figure' mean in Java java.lang.Integer class?

for example, the JDK method java.lang.Integer.numberOfLeadingZeros(int): public static int numberOfLeadingZeros(int i) { // HD, Figure 5-6 if (i == 0) return 32; int n = 1; if (i >>> 16 == 0) { n += 16; i <<= 16; } if (i…
Jason
  • 521
  • 2
  • 7
7
votes
1 answer

Is UseGCOverheadLimit supported with G1 GC?

In HotSpot JVM GC Tuning Guide the UseGCOverheadLimit option is mentioned only on the pages about CMS and Parallel GCs. Additionally, on GC Ergonomics doc page the related options GCTimeLimit and GCHeapFreeLimit are mentioned like if they work only…
leventov
  • 14,760
  • 11
  • 69
  • 98
7
votes
1 answer

Kotlin Back-Tick escaping in method names: How does it work?

In Kotlin, it's possible to name a method using back-ticks like this: fun `i am a test method`(){ Assert.assertEquals("x", "x") } The compiler generates a method with underscores instead of blanks: "i_am_a_test_method", which seems reasonable as…
s1m0nw1
  • 76,759
  • 17
  • 167
  • 196
7
votes
3 answers

java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code

I was wondering if some of the JVM gurus out there can briefly explain the following error. What does it actually mean in technical terms and what are the sequences of events that can lead to this error? java.lang.InternalError: a fault occurred in…
wFateem
  • 346
  • 1
  • 2
  • 11
7
votes
2 answers

Why kotlin doesn't allow covariant mutablemap to be a delegate?

I'm new to Kotlin. When I learn Storing Properties in a Map. I try following usage. class User(val map: MutableMap) { val name: String by map } class User(val map: MutableMap) { val name: String by…
Dean Xu
  • 4,438
  • 1
  • 17
  • 44
7
votes
3 answers

Hashcode of function changing inside atom...why is this happening?

As part of a data visualization app that I'm working on, I've encountered something that's either a bizarre bug or me fundamentally not understanding something. My application has code that takes data structures representing colorscales and…
7
votes
3 answers

How are sockets implemented in JVM?

I want to know, how sockets are implemented in the Java Virtual Machine. Is there a native library included? And if, is it a C library? Where can I find information about this topic? The offical Java tutorial on networking does not help me…
guerda
  • 23,388
  • 27
  • 97
  • 146
7
votes
2 answers

Programmatic notification of JVM's GC events

I would like to track how much time is spent in GC and how much memory has been collected, but not by analysing GC logs (ie. analyzing what I got from -XX:+PrintGCWhatever). I found that I can use Sun's ManagementFactory to get a…
insitu
  • 4,488
  • 3
  • 25
  • 42
7
votes
1 answer

Sigsegv Java Fatal Error when using libjvm.so

I am doing reboot tests on Sles12sp2 using STAF v3.4.24 and after some time I get this error: # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f105e11e712, pid=6577, tid=0x00007f1027efe700 # # JRE…
Adriana
  • 71
  • 1
  • 3
7
votes
3 answers

How to get the max sizes of the heap and permgen from the JVM?

I am trying to find out programatically the max permgen and max heap size with which a the JVM for my program has been invoked, not what is currently available to them. Is there a way to do that? I am familiar with the methods in Java Runtime…
Uri
  • 88,451
  • 51
  • 221
  • 321
7
votes
2 answers

Java Virtual Machine and Swap Space

Apppreciate any expert here could advise for below JVM and swap space related queries. Thanks in advance 1) Am I right that Operating System will use swap space when OutOfMemory occured in JVM Java Heap, Perm Generation or Native Heap ? Or swap…
Leanne
  • 127
  • 1
  • 2
  • 12
1 2 3
99
100