Takes forever to compile

I have been using Arduino for almost a year now, and for all that time it has taken < 20s to compile any program I’ve written. But now for the last few days it’s as if it gets stuck for several minutes. As I’m writing I am compiling the “Fade” example and I’m closing up on 5 mins. However it does not crash or so, it does compile it given enough time (5-10 mins).

Windows 7 Ultimate
Arduino 1.0.5

Does anyone know whats causing this?

Hi Kalveo

Just to clarify, do you mean compile (only) (CTRL-R) or compile and upload to the Arduino (CTRL-U)?

And I assume you do not see any messages in the window at the bottom of the Arduino IDE while the long compile is happening?

Thanks

Ray

Hi, it is just the compiling (tried CTRL-R) and it gets stuck at a half full bar. (CTRL-U gets stuck the same way) There are no error message, no messages at all except the normal size message once the compile eventually is finnished.

If you go into Files - Preferences in the Arduino IDE, there is an option to have verbose output during compiling.

You could try turning that on, then watch the messages in the message box in case it gives an idea of which stage in the process is holding things up.

If possible, can you copy and paste all the messages and post them (using code tags, since they could be long)?

Regards

Ray

Ok, so I did the printing test. There were a few places where the text was orange, otherwise it was white. There seemed to be no specific holdup, just slow all the way. Every “step” of the compiling took between 2-5s.

Can’t paste the text, since it’s over 9.5k chars.

ArduinoCompilePrint.txt (19.5 KB)

Had any bluetooth things get turned on recently? That was causing a big slowdown for folks in the past.

I do have a usb bluetooth adapter connected, but I can't recall using it for the last few months. I unplugged it and tried compiling again, still the same slow compile.

(deleted)

Sorry for the slow reply, but now I've unplugged everything except mouse and keyboard and run both as and as not admin. It's still just as slow as before. I've also tried downloading a new version of the IDE, which I placed on a different hard drive, with no success.

Five suggestions from me:

  1. What does the task manager's cpu usage show before the compilation and during it? Is the cpu maxing-out?

  2. Have you tried booting in safe mode and testing the compilation there?

  3. Casino odds at best but have you thought of defragging your disk if only to eliminate "rusty-cum-disjointed" sectors?

  4. Does anything show up in the Windows event viewer logs?

  5. Scary. I can't remember what the fifth was. :.

When was the last time you cleaned the disk of crap!

Sounds like a standard fragmented and large virtal file/profile problem to me..

Buy a Mac it does not suffer such PC problems.. 8) 8) Happy coding..

  1. CPU is <10% most of the time peaked at 13% usage while doing other stuff aswell. Memory was at around 40% free (8GB total)
  2. I have not tried safemode, will try that next.
  3. I defrag my hard drives like once a month or so and even then they are rarely over 5% fragmented <1% after defrag.
  4. How do I veiw those logs, and what should I be looking for there?
  1. How do I veiw those logs, and what should I be looking for there?

Start button and enter "view event" in the textbox. Select the "View Event Logs" item. Select the Windows Logs in the top left. Click on the Application, Security, and System. If the OS is recording anything problematical you may see some diary of events around the time you're compiling. To be honest though, the event logs store all sorts of messages so there might not be anything in particular that's relevant. Interpreting them is the devil in the detail.

Have you tried compiling on another machine? Gosh! There are so many variables involved. I'm not advocating it, but I usually reformat my disk twice a year and reload the OS an utilities. It's a pain, but it sure helps to clear out the porn crud you accumulate :)

Ok so I did the Safe Mode test and that made the compile go as fast as it used to do. It took me 5-10 seconds to compile any sketch I have. Could this mean there's some conflict causing the slow down?

Safe mode effectively locks out many of the Windows services and some hardware drivers plus other bits and bobs. What might be worth doing in safe mode is looking at the Windows services (Start -> enter "services.msc") and if you can, take some screenshots of the services and those which are started. Reboot in normal mode and take some screenshots again. this time you should notice there are far more, leastways, I hope that would be the case. You might then need to go through each list and look for the ones which might belong to third-party apps you've installed and stop the ones that run in normal mode but which weren't running in safe mode.

The point I'm making is that there could be one or more services which are pulling down your compile but that's purely conjecture on my part. Another thing to look at is to stop any AV program you might have running as they are suspects but not always.

I can't recall but did you reinstall the Arduino IDE and possibly download the latest version?

As safe mode worked that suggests to me there could be either a Windows service or some hardware driver that could be contributing to the compilation time. In the past, I've found it a laborious job trying to hunt down the offender. I don't know the IDE well enough but is there a command line compile option which might throw out some more diagnostics.

I'm sort of glad safe mode worked. I expected it to but the reason is still elusive.

Proving it works in safe mode highlights my previous point...

The virtual machine environment is clogged, the usual reason is the virtual memory file size has got huge, or the user profile file is hige..

Do a tidy up before risking bricking the windows operating system by playing with services, if you get it wrong then a complete rebuild is the only answer

Mazke sure you have all backed up before even trying to start.stop.suspend services...

C:\Users<your username>\AppData\Local\Temp with a bazillion files that need to be cleared out? Could it be windows takes a long time to open/read directory because there are so many entries in the file access table.

verbose logging shows an attempt to access .... .tmp/core.a -LC ..... .tmp -lm and it hangs there. Now, the forward slash doesn't look right in the context of all the backslashes.

THis line follows ...liwquidcrystal.cpp.0 and spi.cpp.o info which seems to have loaded ok.