0

I was looking if there's a way to check the JVM or if the JVM may notify a process when a GC is currently taking place. Is it possible developing an agent with JVMTI? or what would be the best way to do this?

Thanks!

Tagir Valeev
  • 97,161
  • 19
  • 222
  • 334
Jose Monreal Bailey
  • 461
  • 1
  • 5
  • 12
  • 2
    http://stackoverflow.com/questions/895444/java-garbage-collection-log-messages – Necreaux May 13 '15 at 17:31
  • In modern JVMs, garbage collection happens concurrently in the background. What problem are you really trying to solve here? – Greg Hewgill May 13 '15 at 17:32
  • I want to implement a GC Scout, to block my current AS when GC is happening – Jose Monreal Bailey May 13 '15 at 17:35
  • The other question explains how to get something logged, but this question is asking how to be notified. I think there's an MBean notification sent when a GC has completed, but I don't know if there's one when a GC is starting. – Brett Kail May 14 '15 at 22:54
  • It says "check the JVM or the JVM may notify the process", which seems to indicate it's a separate process that wants this information. Parsing the log messages seems adequate for that use case. (If you do find out about the MBean, you could self-answer another question.) – Jeffrey Bosboom May 15 '15 at 00:39

0 Answers0