allocation-instrumenter
allocation-instrumenter copied to clipboard
Dynamic attach java agent
JOL has this neat way of attaching the agent at runtime to avoid requiring users to pass -javaagent on the cmdline. http://hg.openjdk.java.net/code-tools/jol/file/9c716b63a6cf/jol-core/src/main/java/org/openjdk/jol/util/InstrumentationSupport.java
Would you be willing to adopt that approach in this lib?
It's probably okay to have it in there, as long as both methods were supported.
Note that that approach is very implementation-dependent, so we'd have to tell people "try it out, and if it doesn't work, then try it with -javaagent". That might make it harder, rather than easier, to deploy - you have to be aware of the target platform.
That said, I'm unlikely to prioritize it, so we'd need someone to implement it.