Tuesday 30 July 2013

JVM in load testing

The Java Virtual machine (JVM) is the application that executes a Java program and it is included in the Java package.
JVM is the main component of Java architecture and it is the part of the JRE (Java Runtime Enviroment) . JVM is a part of Java Run Time Environment that is required by every operating system requires a different JRE .

Each operating system and CPU architecture requires a JRE.
JVM Runtime Environment contains the two parts such as:
Java API classes: Java API classes are the predefined classes required for the program compilation and interpretation.
Java Virtual Machine: JVM is also a part of the JRE. The Java Virtual Machine is responsible for interpreting Java bytecode, and translating this into actions or operating system calls .

Without the availability of a JRE for a given environment, it is impossible to run Java software.

The Java Runtime Environment (JRE), also known as Java Runtime, is part of the Java Development Kit (JDK), a set of programming tools for developing Javaapplications. The Java Runtime Environment provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files.

During installation, Java Runtime Environment also deploys a plugin that facilitates the execution of applets within local browsers.
JVM is not platform independent.
The Windows JVM is different from the Unix JVM or the Linux JVM. But, your Java code can run on all three without being changed or recompiled (again, unless you interface to native methods, or use other platform-specific stuff).

Java "the language" is platform-independent. To make it so, there is a platform-specific JRE that knows how to run the platform-independent Java code on a specific platform.
Every supported operating system has its own JVM.
JDK includes a JRE as as subset. The JRE provides runtime support for Java applications. The SDK provides the Java compiler and other development tools. The SDK includes the JRE.

When we download JRE, there are different platforms to choose. That means JRE is machine dependent,

In one machine we can create more than 1 JVM. Suppose in load testing there is a problem in JVM then its not a good practice to increase the size of JVM to solve the performance issue.

For analysizing the JVM many tools are available:
1.JProfiler
You can have one JVM per process. Since an OS supports many processes, you can have many JVMs running.
When ever we start a new java process by invoking java.exe (i.e. java [class-name] ) a new instance of JVM is created. Each java process executes in its separate JVM environment – we can specify different JVM parameter for each process

Jconsole - standard freely available
Yourkit profiler - licensed
Netbeans profiler - freely available.
JPerfmeter: Its gud one.

Heap Size:


Increasing the maximum heap size setting can improve startup. When you increase the maximum heap size, you reduce the number of garbage collection occurrences with a 10 percent gain in performance.

Increasing this setting usually improves throughput until the heap becomes too large to reside in physical memory. If the heap size exceeds the available physical memory, and paging occurs, there is a noticeable decrease in performance.
Therefore, it is important that the value you specify for this property allows the heap to be contained within physical memory.

2 comments:

Software Development Company said...

Hello,
The Article on JVM in load testing, gives detailed information about it. Thanks for Sharing the information about Load Testing is amazing. For More information check the detail on the load testing here Software Testing Company

Karthik said...

Nice to read the article which you posted lastly, its helpful to enhance my knowledge as well as for my career
hp loadrunner training in chennai
Loadrunner classes in Chennai
performance testing training in chennai
hp loadrunner training
performance testing training