为什么调试程序在使用方法入口调试时会减慢这么多? [英] Why does the debugged program slow down so much when using method entry debugging?
问题描述
-Xdebug -Xrunjdwp:transport = dt_socket,suspend = y,server = y,address = 1337
简而言之,解释器设置方法条目时。我不认为这个有这样的...
以前在调试模式下运行的所有代码都是这样,但是它在1.4中被增强了... ...现在HotSpot适用于'full -speed'调试,除了方法入口和出口,观察点以及单步执行或包含断点的方法中。
I'm using jdi interfaces to create a debugger and when I use MethodEntryRequests to enable method entry tracing the debugged program slows down by factor of tens. I have set filter for main thread and suspend policy to SUSPEND_EVENT_THREAD. Classfilter is limited and if I print any received events it doesn't show more than couple of dozen of those so it shouldn't receive too much of them. I'm debugging locally and having followind kind of command-line with the debugged java program:
-Xdebug -Xrunjdwp:transport=dt_socket,suspend=y,server=y,address=1337
The short answer is that execution runs through the interpreter when method entries are set. I don't think there is anyway around this...
This used to be the case for all code running in debug mode but it was enhanced in 1.4... now HotSpot works for 'full-speed' debugging except in the case of method entries and exits, watchpoints and when single stepping or in methods that contain breakpoints.
这篇关于为什么调试程序在使用方法入口调试时会减慢这么多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!