dvl
dvl

Reputation: 761

Eclipse breaks on processWorkerExit

After serving a few requests my eclipse has started breaking on processWorkerExit() method.

As per this link I know how to suppress the breaking of eclipse but is there any reason why the code is breaking on this line. Can there be a memory leak in such a case?

Tomcat 7.0.27
Eclipse 3.7.2
JDK 7.0.02

enter image description here

Upvotes: 16

Views: 6831

Answers (3)

capitano666
capitano666

Reputation: 656

Answer is here: OpenJDK breaks on processWorkerExit with no breakpoint

In debug mode in eclipse by default, break on uncaught exceptions is checked. Since you don't have a catch method here, it's likely that an uncaught exception is being thrown and the debugger is breaking for you immediately before the exception is thrown. You can turn it off in preferences under Java->Debug.

Upvotes: 10

Kenan Begić
Kenan Begić

Reputation: 1228

I had this same problem. It breaks in your try/catch clause if you have one if you don't log the exception. Try inserting a breakpoint or output to LogCat like this :

try
{
   //HERE I'VE PUT ALL THE FUNCTIONS THAT WORK FOR ME
   Log.e("tag", "Sth passed!");
}
catch (Exception e)
{
   //The task failed
   Log.e("tag", e.getMessage());           
}

If you don't have try/catch block put it like in above code. In LogCat you can see the last line of code that was run before exception it will help you to locate the error in your code just like this :

08-28 05:49:52.321: E/SQLiteDatabase(834): at java.lang.Thread.run(Thread.java:841)

Upvotes: 0

sharakan
sharakan

Reputation: 6901

The reason the debugger is stopping on that line is because there is an exception being thrown by the code within the try{} block, and that particular line of code is the next executable line of code after the exception is thrown. You can almost certainly see the stack trace of that exception in the console window, because by default an uncaught exception that bubbles up to Thread.run() will be sent to stderr.

As for your question about whether there can be a memory leak (or more likely, this being Java, a resource leak): the answer is yes, there could be. But there is nothing in that code to indicate that there is. If there were such a leak, it would almost certainly be because there is incorrect exception handling inside the task implementation.

Upvotes: 1

Related Questions