what happens on btrace disconnect

  4 posts   Feedicon  
Replies: 3 - Last Post: April 19, 2012 16:28
by: Jaroslav Bachorik
showing 1 - 4 of 4
 
Posted: January 13, 2012 16:54 by gdanov
Hi,
I am playing with BTrace using the btrace command line utility. I am interested to know what happens with the injected byte code when I terminate btrace. Are the instrumented classes reverted? Is my injected bytecode still lying around, inactive?
The point is that I would like to use BTrace on production systems and want to know what is happening with the injected bytecode.

Best Regards,
Georgi
 
Posted: January 15, 2012 18:45 by Jaroslav Bachorik
Hi,
currently the BTrace code is deactivated but the generated classes as well as the instrumentation linger around. Probably we should look into this and find out a way how to remove the inactive BTrace code from the target JVM.

-JB-
 
Posted: April 16, 2012 08:25 by chandler
Hi Jaroslav:
I‘m now studying btrace source code.But i just cant find out how Btrace code been deactivated .Can u give a hand?
 
Posted: April 19, 2012 16:28 by Jaroslav Bachorik
Hi Chandler,
take a look at com.sun.btrace.agent.Client.onExit() method. There you can see that the particular BTrace bytecode transformer is being unregistered and the classes are retransformed, effectively removing all the instrumentation injected in this session.

As I mentioned before the BTrace generated classes (artifacts generated for the compiled BTrace scripts) will hang around indefinitely as they are defined by the bootclassloader and will never get garbage collected. But their methods are virtually unreachable.

-JB-
Replies: 3 - Last Post: April 19, 2012 16:28
by: Jaroslav Bachorik
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close