Application Development: 4 Simple Steps to Resolve Remote Debugging Connection Problems
Jayvardhan Reddy Vanchireddy
Senior Data Engineer at Cognizant?? | Ex-Honeywell | #ONO ?? | #Azure ? | #German B1 Level Certified ???? | Writer@Medium ? | #BigData Engineer ??
As a developer, we frequently debug the application during the development activities. The real time applications are usually deployed on Linux environment for security reasons.
We often face issues trying to establish remote debug connection to the application and at times we are not aware as to why the particular problem occurs. Let's look at some of the quick fixes that can be done.
1. IDE shutdowns abruptly due to less Heap Memory:
When the size of the project is more, you might need to load the complete class files as part of it in-order to build, run and perform debug operations on it. In this cases the IDE crashes due to the shortage of heap memory. You can check the default heap size allocated as shown below. Navigate to Window ->Preferences as below.
In the general section you will find an option show heap status, select the check box to view the size in IDE.
Now look at the bottom of the IDE the heap size will be shown
To prevent IDE from crashing, you can increase the default Heap memory allocated inside IDE files for increasing pagination. Navigate to the installation directory of the IDE.
Change the -Xms and -Xmx values based on the memory of your system.
Restart the IDE after changing the values.
2. Connection timeout error while launching the remote debugger:
Increase the debugger and launch timeout values from Window ->Preferences as below.
3. Connection refused to connect error:
The might occur due to the below reasons
i) Debugger is not started on the server. To check run the below command in cmd prompt and make sure we see 'tcp LISTEN' entry from the response. In case we don’t see any response it means debug agent is not started and make sure debug agent is started to solve it.
ii) After seeing LISTEN entry also we are getting connection refused error means, maybe we need to stop ip tables using
Note: IPTables is a rule based firewall and it is pre-installed on most of Linux environment.
Once the connection to Application Server is established through the client machine, then the netstat command will show the below details.
iii) In case we see 'tcp ESTABLISED' or TIME_WAIT entry here, it means there is stale connection socket on last connection attempt (usually happens when connection is timed out).
Use below step to clean the staled connection from your client machine.
4. Cleaning Stale Client connections:
Basically we need to close the stale client socket from the machine where we started debug session. To know which socket it is connected to, you can check your debug configuration (i.e, port number).
Perform the below steps to close stale connection from windows.
i) Open the tcpview.exe.
ii) Sort the entries by Remote Port.
iii) Locate 8000 Remote Port and right click on the same entry and close the connection as below:
You can download TCPView using the below link.
If you enjoyed reading it ,you can click the like, share button and let others know about it. If you would like me to add anything else, please feel free to leave a response ??
Application Development Senior Analyst
6 年Doing good job jay, keep collect all info and share