metracer – New Release 1.3.10

metracer_logoNew bugfixing release of metracer is available – 1.3.10. This release fixes:

  • object’s dumping in case class contained a self referencing field (issue #54)
  • broken console state when program is closed via Ctrl+C (issue #55)

While working on this release it became clear that object’s dumping must be more smart and tunable – otherwise there is lots of noise when metracer encounters complex system objects. This would be addressed in a next metracer release.



metracer – New Release 1.3.9

After some tough fight a new metracer release is available – 1.3.9 (along with 1.3.8). These releases bring two outstanding features:

  1. Dumping content of arbitrary objects. This rocketlaunches inspection / investigation of Java programs to a completely new heights! All information flowing around inspected program is at your fingertips. E.g.:

    Dumping Content of Custom Objects

    Dumping Content of Custom Objects

  2. Single .jar in distribution without additional launcher scripts – all logic of launches scripts is incorporated into a single jar which makes the distribution. To start using metracer do two simple steps:
  • download a .jar file from latest release
  • launch: java -jar metracer.jar

Have fun and glad to see your feedback!



metracer — New Release 1.3.7

I’m happy to announce a new 1.3.7 release of metracer. Comparing to previously announced 1.3.3 released there were many significant changes including:

  • vertical instrumentation (issue #27)
  • better printing of return values (issue #44)
  • auto-quit when target JVM dies (issue #20)
  • and of course Windows support (issues #28#49#50#51)

Full release notes are available on respective pages: 1.3.4, 1.3.5, 1.3.6 and 1.3.7.


metracer — New Release 1.3.3

I’m happy to announce a new 1.3.3 release of metracer. This release brings several small but very useful features and fixes couple of nasty bugs. See below for a discussion of most notable changes.

Full change list as well as binaries are available on release notes page.


metracer — New Release 1.3.2

New version of metracer 1.3.2 was just released. Compared to a previously announced 1.2.0 release following main changes happened:

# Change Description
 1 Dynamic instrumentation Now it’s possible to inject tracing into a running Java process without any restarts! One can repeat this many times for different classes and methods. After one is finished with experiments all instrumentation traces can be removed leaving application in an original state.
To ease metracer.jar launching a frontend script – – was introduced. One only needs this single script (without any additional bits) to start working! There are a built-in usage notice and help message for a quick on-boarding.
Such dynamic instrumentation was made possible by the use of Java Attach API and  JMX technologies
2 No more promiscuous patching of  ClassLoader Such patching was introduced as an aid against isolation imposed by JavaEE app servers (e.g. WildFly).
It was found another more elegant way to workaround this based on the fact that metracer bits are loaded into a system ClassLoader (see here). Given this one could easily resolve reference to a com.develorium.metracer.Runtime class from any point of program via code:

By using the code snippet above one doesn’t need anymore to patch any class loaders!
3 Improved stability of instrumentation Several design flaws and bugs in an instrumentation code were identified and fixed which lead to java.lang.VerifyError:

  • each call to Runtime.traceEntry or Runtime.traceExit is guarded with try / catch  block. As such any failures there won’t affect inferior application itself
  • proper boxing / unboxing of return value / exception on the stack
  • proper placement of RETURN opcode which is crucial for some reason for static class initializers ( <clinit>  method)

With these changes metracer is now a fully functional developer tool ready for hard use in production! Enjoy the POWER of METRACER!


metracer — New Release 1.2.0

New version of metracer 1.2.0 was just released. Main changes are:

# Change Description
1 Use of ASM for instrumentation  A move was made towards ASM instrumentation framework instead of Javassist. This allowed to:

  • increase performance
  • lower memory footprint
  • get rid of creation of proxy methods – now a tiny pieces of code are injected directly into target methods
2 Reporting of return values Now there is information of return values of instrumented methods, e.g.:metracer_return_value_
3 Extended reporting of exceptions Now the string representation of exception is printed for instrumented methods, e.g.:metracer_exceptions

With these changes metracer became more efficient, lightweight. Changes provide an opportunity for “hot” code instrumentation (without program restart).


metracer – Java Code Instrumentation and Stack Map Frames

Stack Map Frames in Java is a contradictory addition to the language: they speed up class loading but the same time make big troubles for a code instrumentation tools. During adoption of an ASM framework to a metracer I have stumbled with following main two issues:

  1. necessity to resolve a “common super class” during instrumentation which causes many ClassNotFoundException
  2. VerifyError exceptions with message like ‘Stack map does not match the one at exception handler’


metracer – Logging via org.slf4j.Logger

New version 1.1.0 of metracer was released: were many experiments, redesigns and code rewrites. Main changes are around tracing output – now it’s done via org.slf4j.Logger. (issue #8)


metracer – No Runtime Dependencies + Nice Indentation

Based on my experiments with adoption of metracer to JavaEE (link) a new version of metracer 1.0.5 was released. Source code of new 1.0.5 version: svn co


metracer – Adoption to Java EE

Main target audience of a metracer are meant to be enterprise Java applications – metracer must enhance logging of such applications. As such I’ve tried to adopt metracer to a production level Java EE application which runs under WildFly AS. Speaking in terms of RPG games – tons of experience was earned :-). Results of my experiments are below.