• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Query on GC for Old Gen

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

We are using the below configuration for our application server on Java 7. It has around 15 GB of RAM
-XX:+DisableExplicitGC
-XX:MaxNewSize=2G
-XX:MaxPermSize=512m
-XX:NewSize=2G
-XX:PermSize=512m
-XX:SurvivorRatio=6
-Xms8G
-Xmx8G

My query is when the Old Gen reaches above 95% the Major GC is not called. I have tried to wait till 99% usage of Old Gen but still it is not called. Is it normal behavior ?

1. Is there any specific reason for it ?
2. Do i need to change the Garbage Collector?
3. Is there any argument by which we can force a major GC or this is bad idea ?

Appreciate your help on this.

Thanks,
Sachin
 
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to CodeRanch Sachin!

What tools are you using to track memory usage and garbage collection?
 
Sachin Hulawale
Greenhorn
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Stephan.

I am using AppDynamics to monitor heap usage and GC occurrence.

Regards,
Sachin
 
Stephan van Hulst
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, I believe major GC is only done when the heap is full, not when old gen is at 95%. I'm not certain though.

Are you sure that your objects are eligible for garbage collection?
 
Sachin Hulawale
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:First of all, I believe major GC is only done when the heap is full, not when old gen is at 95%. I'm not certain though.

Are you sure that your objects are eligible for garbage collection?



Actually we have multiple applications and i have seen Major GC occurrence before 90 or 95% and yes the configuration is different for them so it might be the case.

About the objects being eligible or not - The usage of application is daily except weekends and Old gen has been above 90% for around 3-4 days.

Regards,
Sachin
 
Stephan van Hulst
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sachin Hulawale wrote:The usage of application is daily except weekends and Old gen has been above 90% for around 3-4 days.


Well, that doesn't really answer my question. Old gen is populated by objects that survive many garbage collection cycles. What makes you think they would suddenly become eligible for garbage collection? Maybe you have a memory leak somewhere?

Is this issue causing problems in your applications?
 
Sachin Hulawale
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I agree i may not be clear about it. I dont have enough understanding about the object behavior but i expected major GC to be called as it was stuck for 3-4 days ( i know it will depend on objects progression but still)

we have not  received any OOM errors as such, but we do get  DB exceptions when Old Gen is around 99%

Regards,
Sachin
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What db exceptions?
 
Sachin Hulawale
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:What db exceptions?



So DB exceptions were related to some other issue. There was patch updates in DB, so i don't think it was related to it.

Still, is it acceptable behavior for Old Gen to reach above 95% without Major GC being called.

Regards,
Sachin
 
Stephan van Hulst
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wouldn't worry about the specifics of the garbage collector. If you're worried that your application is using too much memory, profile it to see where the most of the memory is used and if the usage of that memory is justified. If it is, and your program is not crashing or running slower because of it, then what is the problem?
 
Sachin Hulawale
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:I wouldn't worry about the specifics of the garbage collector. If you're worried that your application is using too much memory, profile it to see where the most of the memory is used and if the usage of that memory is justified. If it is, and your program is not crashing or running slower because of it, then what is the problem?



Thanks Stephan.

Over time, if Eden space also starts to fill up. I see the GC time spent increase which leads to slowness in Business transaction. As such from GUI perspective, i dont see any hanging of application.

Regards,
Sachin
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic