• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JVM Default Garbage Collector

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apart from using jconsole, Is there any location/configuration file that I can look at to know the garbage collector thats in use ? Or Can I print the name of the garbage collector in use using any JVM Command/options?
 
Marshal
Posts: 79471
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult a question for "beginning Java". Moving thread.
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I was studying for SCJP in any moment they mention this. They say that all you need to know is that you can sugest to the Garbage Collection to take action.

And nothing more...

Why would you want such thing?
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the following command: java -verbose:gc className
 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hebert Coelho wrote:When I was studying for SCJP in any moment they mention this. They say that all you need to know is that you can sugest to the Garbage Collection to take action.

And nothing more...

Why would you want such thing?



My application is running fine on JDK 1.6 Update 14(Oracle WebLogic 11g(10.3.2) ) . But my app server JVM is getting crashed on JDK 1.6 Update 12(Oracle Weblogic 10.3.0).
From Update 14, Sun has implemented a new G1 garbage collector. I just want to know whether the crash is due to the garbage collector in JDK 1.6 update 12 because from the JDK 1.6 documentation I can see that there is some bug in the CMS garbage collector which corrupts the heap and crashes the JVM.

I want to check the name of the garbage collector in both the versions to see if they are using the same default garbage collector.




 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wouter Oet wrote:You can use the following command: java -verbose:gc className



This command simply doesn't work !!
 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I know which is the default garbage collector for every update of JDK? Can I see this information in any documentation from Sun ?
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sri Harsha Yenuganti wrote:This command simply doesn't work !!


Actually it does work but it gives other results then you asking for (I later realized). It shows which gc'tor clears how much memory and how long it took to do that. But I don't know how to get their names.
reply
    Bookmark Topic Watch Topic
  • New Topic