Garbage collection in java, JAVA Programming

Assignment Help:

The Java programming language is object-oriented and includes automatic garbage collection. Garbage collection is the process of reclaiming memory taken up by unreferenced objects.

Memory Management, Java and Impact on Application Servers

The task of memory management that was always challenging with compiled object-oriented languages such as C++. On the other hand, Java is an interpretive language that takes this memory management out of the hands of developers and gives it directly to the virtual machine where the code will be run. This means that for best performance and stability, it is critical that the Java parameters for the virtual machine be understood and managed by the Application Server deployment team. This section will describe the various parts of the Java heap and then list some useful parameters and tuning tips for ensuring correct runtime stability and performance of Application Servers.

Java Virtual Machines

The Java specification as to what is “standard” for a given release is written and maintained by the JavaSoft division of Sun Microsystems. This specification is then delivered to other JVM providers (IBM, HP, etc). JavaSoft provides the standard implementation on Windows, Solaris, and LINUX. Other platforms are required to deliver the code functionality but their JVM options can be different. Java options that are preceded with “-X” or “-XX” are typically platform-specific. That being said, many options are used on all platforms. One must read in detail the README notes from the various releases on various platforms to be kept up-to-date with the variations. This guide will mention the most critical ones and distinguish between those which are implemented on most platforms and those which are platform-specific.

The Java Heap

The Java heap is divided into three main sections: Young Generation, Old Generation and the Permanent Generation as shown in the figure below.

 

Also, not shown here, is another area called the Code Cache which is typically about 50Mb in Size.

 

HotSpot VM

 

The HotSpot VM is the garbage collector that comes with the JavaSoft virtual machine. Its specification is delivered to all JVM providers (HP, IBM, BEA, etc) and the standard implementation is deployed by JavaSoft on Solaris, Windows and LINUX.

 

Default Garbage Collection Algorithms

 

Scavenge Garbage Collection

 

Scavenge Garbage Collection (also known as a Minor Collection) occurs when the Eden Space is full. By default, it is single-threaded but does not interrupt the other threads working on objects. It can be parallelized starting at Java 1.4 but if too more ParallelGCThreads are specified than CPU cores where the JVM is running, this can cause bottlenecks. For this reason, it is suggested to be careful in when and where to use the parallel options. These will be discussed further on.

 

Full Garbage Collection

 

A Full Garbage Collection (FullGC) occurs under these conditions:

 

The Java application explicitly calls System.gc(). This can be avoided by implementing the -

 

XX:+DisableExplicitGC parameter in the startup command for all Application Server JVMs (Tomcat,Application Server JVM, etc.)


Related Discussions:- Garbage collection in java

Texas holdem poker java game source code, Texas Hold'em Poker Java Game Sou...

Texas Hold'em Poker Java Game Source Code Project Description: I am seeking Java source code for a Texas Hold'em Poker game. The game could have client and server side mod

I want solution to this question., This assignment is based on the principl...

This assignment is based on the principles of clock consistency and associated drifts in a distributed system. You have to create a simulation, running on a single machine, of a si

Developing a prototype system in php and javascript, General Overview A...

General Overview A number of organisations are using micro-blogging as a cost-effective way of communicating with customers, building online communities and releasing informati

How you returning values from methods in java, How you Returning Values Fro...

How you Returning Values From Methods in java ? It's frequent meaningful to have a method return a value to the class which is known as it. This is accomplished through the ret

Minimumshelf, Write a program that finds the minimum total number of shelve...

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process

Cadence design systems, Cadence Design Systems:   Role Working ...

Cadence Design Systems:   Role Working on tickets including debugging of unix based applications Installations of unix based tools/utlity Installation

Need graphic designer and developer, My name is Myers, the project director...

My name is Myers, the project director of an online business that is scheduled to commence this summer in Nigeria. We are in the process of recruiting members to the project team a

What are the two primary methods of implementing security, Question : a...

Question : a) There are up to 14 different built-in groups that might be located by default in the Builtin container including "Account Operators", "Incoming Forest Trust Bui

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd