As we know we can not force JVM for Garbage Collection , but Java7 introduced Garbage First Collector is this new technique much powerful and resolve the issue of Memory leak sometime in application? Someone please give some light over this feature of Java7. How it will be useful for any web application or any application?
Asked
Active
Viewed 1,169 times
1 Answers
4
Recommended Use Cases for G1
The first focus of G1 is to provide a solution for users running applications that require large heaps with limited GC latency. This means heap sizes of around 6GB or larger, and stable and predictable pause time below 0.5 seconds.
Applications running today with either the CMS or the ParallelOld garbage collector would benefit switching to G1 if the application has one or more of the following traits.
More than 50% of the Java heap is occupied with live data. The rate of object allocation rate or promotion varies significantly. Undesired long garbage collection or compaction pauses (longer than 0.5 to 1 second)
You may refer oracle documentation for more information
-
Thanks for your reply .Can we pro grammatically understand this concept how we can implement it in our application? – Jul 23 '13 at 04:45
-
1What do you mean by programatically implement? You don't need to implement anything, you will just tell jvm as startup flag that use G1 garbage collector. Here is link which tells how to specify these flags http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#G1Options – kosa Jul 23 '13 at 04:46