background preloader

Tuning

Facebook Twitter

Memory

Some Aspects of JVM Tuning in Virtual Environments. I have a dream... No, I will not speak here about jobs and freedom. I have a dream that I have been no more called from operation team. I want to hear nothing about performance problems with highly loaded java application in production. The operation people have the most "fat" computer with a lot of CPUs and a huge amount of RAM. That hardware supports many virtual environments and it supports them really very good.

So, what is the problem? Each environment has enough RAM and gets some CPUs (or cores in case of CPU from Intel). You can say: the Java is not the decision for heavy loaded applications. At first, we have a virtual environment with some (mostly two or three) CPUs and the big enough RAM. This is on the one hand. -Dcom.sun.management.jmxremote -Dcom.sun.management.config.file=your_file where your_file - is a JMX configuration file.

In my case it is equal to 8. The second one: use jmap tool from jdk installation with such parameters: jmap -heap PID, A Collection of JVM Options. Software Secret Weapons by Pavel Simakov: The Last Java Garbage. Introduction Java's garbage collection (GC) has made life easier, perhaps, immeasurably, for developers. However, automatic memory management does not come without costs. Garbage collection cycles are unpredictable and applications may be susceptible to "pauses" or other performance issues while garbage collection is taking place. As the Java Virtual Machine (JVM) has matured, there have been improvements introduced to minimize the impact of GC on applications. For example, you can now choose what kind of GC to use for your application.

Which GC options to choose? In this article I will show you a simple technique that actually shows how objects are created and garbage collected at runtime. The crucial test Being quite determined to get to the bottom of the garbage collection issues, I set up a small test. When objects are allocatedwhen objects become eligible for garbage collectionwhen objects are actually freed, and memory is released Young generation garbage collection algorithms are: Performance Tuning Garbage Collection in Java. This document is a summary or outline of Sun's document: Tuning Garbage collection with the 1.4.2 Hotspot JVM located here: 1.0 Introduction For many applications garbage collection performance is not significant Default collector should be first choice2.0 Generations Most straightforward GC will just iterate over every object in the heap and determine if any other objects reference it.

This gets really slow as the number of objects in the heap increase GC's therefor make assumptions about how your application runs. Most common assumption is that an object is most likely to die shortly after it was created: called infant mortality This assumes that an object that has been around for a while, will likely stay around for a while. GC organizes objects into generations (young, tenured, and perm) This is important!