- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Eclipse IDE freeze : ScalaPresentationCompiler blocking for tens of seconds
Thu, 2010-03-11, 14:46
Hello,
I'm using the Eclipse snapshot plugin 2.8.0.r21113-b20100309020141
(updated yesterday or something like that), and I'm encountering huge
freezes of the IDE as soon as I try to edit a Scala file.
These stop happens anywhere and whatever I'm typing - I mean, it's not
only when I save, or when the IDE is asked to autocomplete something. It
may happen when I'm moving the cursor with arrows, when I'm writing
comments, when I'm deleting text, etc.
Freezes happen really often (I can't write for more than some minutes
without such a freeze happening) and they last really long, several
seconds to several tens of seconds (even almost one minute in one case)
and so that makes Scala Eclipse plugin not usable.
It seems that it's the "scala presentation compiler" that is doing
something during that time and is blocking the main thread - at least,
it's what seems to show jvisualvm.
I join to thread dump took during such a freeze, hopefully they will help.
Cheers,
Thu, 2010-03-11, 16:17
#2
Re: Eclipse IDE freeze : ScalaPresentationCompiler blocking for
Do you have Build Automatically turned on?
Eclipse is very happy to run its builds to completion and make you wait, even if it takes 10 minutes. I'm not happy about this either, but turning off automatic builds makes it a problem that is at least under my control.
David
On 2010-03-11, at 8:46 AM, Francois wrote:
> Hello,
>
> I'm using the Eclipse snapshot plugin 2.8.0.r21113-b20100309020141 (updated yesterday or something like that), and I'm encountering huge freezes of the IDE as soon as I try to edit a Scala file.
>
> These stop happens anywhere and whatever I'm typing - I mean, it's not only when I save, or when the IDE is asked to autocomplete something. It may happen when I'm moving the cursor with arrows, when I'm writing comments, when I'm deleting text, etc.
>
> Freezes happen really often (I can't write for more than some minutes without such a freeze happening) and they last really long, several seconds to several tens of seconds (even almost one minute in one case) and so that makes Scala Eclipse plugin not usable.
>
> It seems that it's the "scala presentation compiler" that is doing something during that time and is blocking the main thread - at least, it's what seems to show jvisualvm.
>
> I join to thread dump took during such a freeze, hopefully they will help.
>
> Cheers,
>
Thu, 2010-03-11, 16:27
#3
Re: Eclipse IDE freeze : ScalaPresentationCompiler blocking for
Le 11/03/2010 16:10, David Chase a écrit :
>
> Do you have Build Automatically turned on?
>
Tried with automatic build on and off. And I don't think it's linked to
compilation, since it happens even when I move the cursor or things like
that.
Thu, 2010-03-11, 22:57
#4
Re: Eclipse IDE freeze : ScalaPresentationCompiler blocking fo
On Thu, Mar 11, 2010 at 1:46 PM, Francois wrote:
> I'm using the Eclipse snapshot plugin 2.8.0.r21113-b20100309020141 (updated
> yesterday or something like that), and I'm encountering huge freezes of the
> IDE as soon as I try to edit a Scala file.
>
> These stop happens anywhere and whatever I'm typing - I mean, it's not only
> when I save, or when the IDE is asked to autocomplete something. It may
> happen when I'm moving the cursor with arrows, when I'm writing comments,
> when I'm deleting text, etc.
>
> Freezes happen really often (I can't write for more than some minutes
> without such a freeze happening) and they last really long, several seconds
> to several tens of seconds (even almost one minute in one case) and so that
> makes Scala Eclipse plugin not usable.
>
> It seems that it's the "scala presentation compiler" that is doing something
> during that time and is blocking the main thread - at least, it's what seems
> to show jvisualvm.
What's happening is that a short time after you stop typing, the JDT
reconciler is running to update the JDTs view of your code (eg.
outlines are updated etc.). This causes the file you're editing to be
typechecked by the Scala presentation compiler, and that will be the
time consuming component.
I'm very surprised that you're seeing such long pauses however. Is
your project large and complex (meaning: larger and more complex than
scalac)? What JVM configuration do you have for Eclipse? What sort of
spec is the machine you're seeing this on?
Cheers,
Miles
Fri, 2010-03-12, 00:47
#5
Re: Eclipse IDE freeze : ScalaPresentationCompiler blocking for
Le 11/03/2010 22:53, Miles Sabin a écrit :
> This causes the file you're editing to be
> typechecked by the Scala presentation compiler, and that will be the
> time consuming component.
What is strange is that long pauses happen even when moving the cursor
around - things that should not change typechecking since the file
didn't change.
> I'm very surprised that you're seeing such long pauses however. Is
> your project large and complex (meaning: larger and more complex than
> scalac)? What JVM configuration do you have for Eclipse? What sort of
> spec is the machine you're seeing this on?
I'm quite surprised too :)
In no case the project is more complex than Scalac, it's only some
hundred of compiled class.
We try many different JVM configuration, the one proposed on
http://www.scala-lang.org/node/94 among others (other GC, bigger heap,
other option like number of gc or jit threads, etc).
We run rather modern laptop (Dell Vostro 1520, 4Go RAM, Intel Core 2 duo
P8700@2.53GH, 7200rpm hd), with Ubuntu 9.10.
The pause were not so long with older Scala plugin, so either something
change in our project recently, or something change in Eclipse (Scala
plugin, another Eclipse plugin ?)
Also, we just remarked that there was an older couple of scala plugin
related jar in eclipse/plugins, and removing them seems to somewhat have
made things nicer - even if I don't understand at all why.
In the end, I reinstalled Eclipse/cleared .metadatas, and I put my
workspace in a tmpfs in RAM. And now, things are *much* smoother - even
enjoyable. I will blog about how to do that (it's super simple on Linux).
Fri, 2010-03-12, 00:57
#6
Re: Eclipse IDE freeze : ScalaPresentationCompiler blocking fo
On Thu, Mar 11, 2010 at 11:38 PM, Francois wrote:
> In the end, I reinstalled Eclipse/cleared .metadatas, and I put my workspace
> in a tmpfs in RAM. And now, things are *much* smoother - even enjoyable. I
> will blog about how to do that (it's super simple on Linux).
So the problem is solved now? Was the fresh install/workspace
sufficient to eliminate the worst of the problem or was the tmpfs
necessary as well?
Cheers,
Miles
Fri, 2010-03-12, 07:37
#7
Re: Eclipse IDE freeze : ScalaPresentationCompiler blocking for
Le 12/03/2010 00:44, Miles Sabin a écrit :
> So the problem is solved now? Was the fresh install/workspace
> sufficient to eliminate the worst of the problem or was the tmpfs
> necessary as well?
No, problem not solved: I still see short pause (less than 2-3 seconds)
in tmpfs, and if I use a workspace not in RAM, the long pause are still
there (and so, it seems to be something i/o related).
Hey Francois,
On Thu, Mar 11, 2010 at 1:46 PM, Francois wrote:
> Freezes happen really often (I can't write for more than some minutes
> without such a freeze happening) and they last really long, several seconds
> to several tens of seconds (even almost one minute in one case) and so that
> makes Scala Eclipse plugin not usable.
I've experienced the freezing (although it was less severe in my case)
and it would be really nice to see it go. As a general rule, it would
be nice if the editor would always accept user input.
Ismael