Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there an overhead on setting a JVM to listen to debug port?

I want to be able to debug production systems with jdwp. for this I want to add -Xdebug -Xrunjdwp:transport=dt_socket,address=11122,server=y,suspend=n to each java process I am starting.
Is there any overhead for that in case the port is not activated?
is my JVM going to run slower in this case?

like image 811
oshai Avatar asked Jun 27 '11 09:06

oshai


People also ask

How do you set the JVM property of the server to debug?

Enable JVM DebuggingClick Java > JVM Settings tab. Under Debug Java Settings, select the Enable Debug checkbox. Provide JVM options as necessary by clicking the New button. If you substitute suspend=y, the JVM starts in suspended mode and stays suspended until a debugger attaches to it.

How does JVM debugging work?

Since in the JVM architecture, the debugging functionality is not found within the JVM itself but is abstracted away into external tools (that are aptly referred to as debuggers), these tools can either reside on the local machine running the JVM being debugged or be run from am external machine.

How do I enable remote debugging in Java?

Click on + sign and select Remote. Give any name for your remote-debugging configuration. For say, my-debug. Give Host name and port of the server machine where application is running which you want to debug.


1 Answers

AFAIK, the answer is yes. -Xdebug turns off some runtime optimizations, etc.

In addition, the fact that it's possible to connect to the JVM via jwdp, isn't secure very much. I don't think any production environment should allow this.

like image 52
Tarlog Avatar answered Nov 02 '22 06:11

Tarlog