Prev Next

Java / JVM

Could not find what you were looking for? send us the question and we would be happy to answer your question.

1. What is JVM?

VM(Java Virtual Machine) acts as a run-time engine to run Java applications. JVM is the one that actually calls the main method present in a Java class. JVM is a part of JRE(Java Runtime Environment).

JVM enables a computer to run Java programs as well as programs written in other languages and compiled to Java bytecode.

2. Explain the role of the class loader.

The class loader performs the below 3 activities in the mentioned order:

Loading: finds and imports the binary data for a type.

Linking: performs verification, preparation, and optionally resolution.

  • Verification: ensures the correctness of the imported type.
  • Preparation: allocates memory for class variables and initializing the memory to default values.
  • Resolution: transforms symbolic references from the type into direct references.

Initialization: invokes Java code that initializes class variables to their proper starting values.

3. When bottom up approach is good for JVM tuning?

Bottom up approach is considered for tuning when application is running in PROD environment where no immediate code change is possible.

4. Different approaches in JVM tuning.
  • Top down approach.
  • Bottom up approach.
«
»
Java8 streams

Comments & Discussions