amazon web services - How to determine that a jvm app does more GC than normal work? -


we had problem our ec2 instances had 90-100 percent cpu load cause of bug in library include created many objects instead of reusing them (which easy solvable), spent time in gc.

unfortunately aws health checks , instance status metrics didn't cause overloaded instances stopped , new ones restarted, after time hit max autoscaling number and....died. our own health checks inside app used elb simple answered enough not cause instances terminated...and restarted, mitigate problem quite time.

my idea use our custom health check included in elb health checks report failure if spent time in gc.

how such thing inside app?

there number of jvm parameters allow gc monitoring

-xloggc:<file> // logs gc activity file -xx:+printgcdetails // tells how different generations impacted 

you can either parse these logs or use specific tool such gcviewer analyse gc activity.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -