86

Since recently it's much slower running a program in Debug mode in Eclipse Galileo.

I'm not aware of any changes.

Do you know what could be the cause? Running it normally is not a problem.

  • 1
    Could some sort of profiling have been enabled? – Schultz9999 Jan 04 '11 at 06:36
  • I just switched from Galileo to Helios but without any improvement. –  Jan 04 '11 at 06:58
  • How could I enabled/disable profiling? –  Jan 04 '11 at 07:01
  • debugging a regular program, or a plugin/rcp? – kem Jan 04 '11 at 07:05
  • A regular program (using Spring and Maven). –  Jan 04 '11 at 07:07
  • debug in 'Remote application' mode? – 卢声远 Shengyuan Lu Jan 04 '11 at 07:08
  • I don't think so. How could I verify that? –  Jan 04 '11 at 07:25
  • Did this affect Apache Tomcat? I experienced a grave slowdown with Apache Tomcat 8.5 under Eclipse 2023-03. Adding a single method exit breakpoint caused starting Tomcat in debug mode to go from 40 to 70 s to a whopping 2 to 3 ks, and it would remain unusably slow once started. Progress would show "Preparing launch delegate...: Establishing debug connection..." during tens of minutes. This happened even if the breakpoint was not hit. – Philippe Cloutier Apr 25 '23 at 14:53

16 Answers16

213

Another "debugging break" is the use of method entry/exit breakpoints.

Did you try to remove all breakpoint definitions once?

Sometimes i think Eclipse is getting out of synch with some of its internal/displayed state. Perhaps you should try to setup a new (not copy) of your workspace. This sometimes helps me to recover from spurious features.

This is how you can remove all breakPoints

Eclipse -> Run -> Remove All Breakpoints - for removing all Breakpoints for all Time

Eclipse -> Run -> Skip All Breakpoints - for temporary remove breakpoints

Aubin
  • 14,617
  • 9
  • 61
  • 84
mtraut
  • 4,720
  • 3
  • 24
  • 33
  • I've created a new workspaced and checked out the there anew. Now debugging works as excepted. Do you know how I can fix my old workspace? –  Jan 04 '11 at 13:32
  • 7
    I can only recommend to abandon it unless you want to learn about the meaning of approximately 1.000.000 files in the .metadata directory of your workspace. I have no idea of how to recover... There is the fairy tale of adding "-clean" once to the commandline, but it never helped... – mtraut Jan 04 '11 at 13:52
  • 11
    Starting Eclipse with "-clean" fixed it for me. :-) –  Jan 05 '11 at 08:51
  • 8
    Thank you, removing the method entry breakpoint that I had already forgotten about solved my performance problems! – ChristophK May 23 '13 at 10:50
  • Deleting all breakpoints worked for me. I found not everything ran slowly. Maybe only code in classes with troublesome breakpoints? – TimK Feb 14 '14 at 01:05
  • 11
    Thank you. For me, it was removing all breakpoints and expressions that helped. What's curious is that these very breakpoints did not cause problems in the past - and suddenly, from one application startup to the next, they do. It seems to be an internal problem of eclipse. – Simon Voggeneder Jun 11 '15 at 09:43
  • thanks dude this worked for me , spent almost a day waiting for eclipse to start taking almost 5 mins .The solution was simple !! – Mayur Apr 26 '17 at 16:43
  • that was it for me. +1 – Mukul Goel Sep 18 '17 at 10:56
  • removing method entry-exit breakpoints worked for me. Thanks! – Nisarg Patil Apr 10 '18 at 09:09
  • Although the main question is related to Java and Eclipse, the same thing helped me with PHPStorm+xDebug. Deleting all breakpoints extremely increased debug performance. You can remove all breakpoints in PHPStorm with keyboard shortcut `Ctrl+Shift+F8` – Serhii Popov Feb 08 '20 at 09:52
  • This worked for me too. One important thing I want to mention here is, I faced this kind of issue in one application only while other application worked fine!, so the issue might be application specific rather than a workspace specific!! – Logesh S Jul 20 '20 at 17:16
35

I faced this issue lot of time. Solution is simple, Remove all breakpoints. (Run >> Remove All Breakpoints)

Varun Mylaraiah
  • 391
  • 3
  • 2
14

I was just running a program in Eclipse debug mode that was almost instant without debugging but when I ran it in debug mode, it was really slow. I went through and deleted a ton of random useless breakpoints I wasn't using and then the program sped up A LOT (200x or so).

zelinka
  • 3,271
  • 6
  • 29
  • 42
  • This was helpful for me - i had breakpoints from other projects in the same workspace, i deleted them all and my current program debug sped up – JavaTec Feb 21 '18 at 16:21
12

Disable 'Show method result after a step operation'.

Show method result after a step operation

ceklock
  • 6,143
  • 10
  • 56
  • 78
6

Close eclipse... clear %temp% folder, temp folder... disable breakpoints... in most cases this will definitely solve the problem.

Navdeep Garg
  • 69
  • 1
  • 1
5

I have found that i often forget that i have a bunch of expressions added to the expressions panel that are no longer needed that are none the less being evaluated (or are failing to evaluate) and this slows stuff down a good deal. Make sure that you keep those expressions cleared out when not needed.

MeBigFatGuy
  • 28,272
  • 7
  • 61
  • 66
4

What kind of JVM are you attaching to? I found in my experience, that in debug mode IBM JDK is slow like hell. For all JVMs, check if you have conditional breakpoints with expensive condition. Try disable breakpoints. You may have exception breakpoints or expressions. Try disable or remove them.

Gábor Lipták
  • 9,646
  • 2
  • 59
  • 113
2

In my case, Eclipse was trying to build files, which I was doing manually. Going to Window -> Preferences -> Run/Debug -> Launching, and then disabling "Build (if required) before Launching" underneath General Options solved the slowness.

cal
  • 121
  • 6
1

Clearing temp files on Windows fixed it for me

"C:\\Documents and Settings\\{user}\\Local Settings\\Temp"
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0

Normally Java Virtual Machine turns off Just in time compiler (JIT) when running in debug mode. On IBM WebSphere, the IBM JDK is heavy de-optimized and will be very slow. By the way debugging also make impossible to recompile and optimize the code.

Relay on logging for complex debugging: it will save your days on production, where you cannot debug for sure.

daitangio
  • 583
  • 1
  • 6
  • 18
  • 1
    *Normally Java Virtual Machine turns off Just in time compiler (JIT) when running in debug mode* this is simply untrue. the method is optimized normally when a breakpoint is set the method is deoptimized and executed by the interpreter. – bestsss Jan 31 '13 at 15:16
  • Older IBM JVM (1.4-) was very slow indeed. Anyway de-optimizing method, rebuilding stack trace and so on is a SLOW operation, isn't it? – daitangio Jun 02 '13 at 15:09
  • Deoptimizing is need only for breakpoint in debug mode - NOT for getting stacktrace alone. Deoptimizing is of course a very slow process. Stacktraces SHOULD not be generated (i.e. walk the stack) unless necessary, that is if an exception doesn't print its stacktrace or getStackTrace is not called. AFAIK both Sun and IBM's JVM 1.4 run w/ normal speed in debug mode (sure about Sun's) – bestsss Jun 02 '13 at 18:15
0

With all the learning over the years working with eclipse, here are couple of suggestions

  1. keep your open projects to minimal what you actually need
  2. keep it lean and thin - uninstall the plugins/features which you don't use (mylnn, validations etc).
  3. No matter what you do, the eclipse tend to get slower over the time. The ultimate solution to get a responsive IDE is to recycle your existing workspace (create new workspace and bring in the projects which you need).
Nrj
  • 6,723
  • 7
  • 46
  • 58
0

Before you run your application in debug mode press on Button (disable all breakpoints) and you wont experience slow loading or any problems. After your application has started just enable the breakpoints and then you can debug your code.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Alex Vulchev
  • 201
  • 1
  • 2
  • 15
0

I faced this issue recently after upgrading my macOS version. I wasn't able to fix the slow debugger with all the above solutions, I ended up installing a newer version of eclipse, and everything works prefect after that.

Hany Sakr
  • 2,591
  • 28
  • 27
0

It happened to me once and the problem was, I had the folder with ALL my projects source code in the Source Look-up. This way, not only the debugger got really slow (because it probably crawled all my files) but also I could not do a lot of things such as inline execution.

The takeaway: check your Source Look-up. When debugging right-click in any thread from the Debug view, choose Edit Source Look-up and see what what you can/should remove from there. In my case, it was a spurious folder, other times you may have too many projects, folders, JARs etc. and may remove some.

brandizzi
  • 26,083
  • 8
  • 103
  • 158
0

Recently i was having extreme slow performance debug, both in eclipse and visual studio code (vs code)

In my case, the problem was with lombok configuration in JPA entities.

I changed the @Data anottation to @Getters and @Setters.

Looks like hashCode() and equals() implementantion of lombok was in conflict with JPA.

Daniel Reis
  • 850
  • 9
  • 10
0

I've had the same problem. The work around i'm using is to just set a single break point and run to it. After that I don't try to step over or continue i just restart the test and move my break point to the next line I want to view. I am using JUnit with Mockito in Intellij. I'm guessing it has something to do with the byte code manipulation not matching the actual code in intellij. (In intellij, there is an implementation internal to intellij for running JUnit tests. Mockito may not play will with it)

janst
  • 102
  • 10
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32248560) – cabad Jul 18 '22 at 20:20