java.lang.instrument 有多成熟?
我将致力于一个用于检测相对复杂的 java 应用程序的项目,并且我计划使用 java.lang.instrument 来挂钩 JVM 并在加载类之前重新定义类。
您对此套餐有何看法?跨 JVM 是否得到良好支持?与热点配合使用效果好吗?
谢谢!
I'll be working on a project for instrumenting a relatively complex java application, and I'm planning to use java.lang.instrument to hook into the JVM and redefine classes before they're loaded.
What is your take on this package? Is it well supported across JVMs? Does it work well with Hotspot?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
java.lang.instrument 被许多非常流行的框架和软件使用,包括:
,这让我得出这样的结论:它可以保存使用。 (也许不是你的情况,但这不是问题)。
我在使用 HotSpot 编译器时使用了所有给定的框架,没有遇到任何问题。
java.lang.instrument is used by many very popular frameworks and pieces of software, including:
which leds me to the conclusion that it is save to use. (Maybe not in your in case but that wasn't the question).
I use all the given frameworks while using the HotSpot compiler, and got no problems.
如果您想分析 java 应用程序,我建议使用现有的 java 分析器,因为这个 API 肯定仍然很新并且存在一些问题。
尽管以下文章写于 2005 年,但研究结果仍然具有现实意义
http:// www.javalobby.org/java/forums/t19309.html
If you want to profile the java application, I would suggest using existing java profilers as this API is definitely still pretty new and has some issues.
Though the following article was written in 2005, the findings pretty much are still relevant
http://www.javalobby.org/java/forums/t19309.html