Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How large is the -Xdebug flag overhead?

Tags:

java

debugging

I wonder how large the performance overhead that the -Xdebug flag introduces?

It's very convenient to debug production applications, but I guess it is expensive to leave running all the time?

Also, is there a good way to make the already running application to listen via Debug port, without re-launching it?

Thanks.

like image 927
SyBer Avatar asked Jan 06 '11 15:01

SyBer


2 Answers

We haven't found any difference. We run all our production applications with -Xdebug.

is there a good way to add Debug mode to application already running, without re-launch it

It is what -Xdebug does. Debugger actually starts when someone connects to debugging port.

like image 134
stepancheg Avatar answered Sep 19 '22 23:09

stepancheg


Under Java 6 I would say the cost is about 15% to performance, Under Java 5.0 it was about 40%. This may be fine for you.

Another way to see what is going on in production is to use JMX/JConsole. This takes some work and has a relatively small over head. I guess at 2%.

like image 40
Peter Lawrey Avatar answered Sep 18 '22 23:09

Peter Lawrey