an Eclipse question: it hangs for a long time if has not been used recently

Z

zyng

Hi,

We use Eclipse to develop Java standalone applications. One thing I found is that if I have not used Eclipse for one or two weeks, when I start Eclipse (using the same workspace), it just hangs there for a long time(with these messages -- "initializing Java tool..", "copy source to output..."). It hangs about 30 minutes, then it is ok. However, if I do a Refresh(F5), then the hanging will be again. By looking at cpu information, the process of eclipse is constantly busy, even when the hanging has been gone. It seems that Eclipse is doing some heavy duty thing on the background.

After a long, long time(one or two hours), eclipse is quiet and everything is fine. It is just painful.

I found that if I keep using Eclipse everyday, this kind of problem does not happen at all.

Can you help me understand why and is there any way to avoid the problem?

Thank you very much. I greatly appreciate your help.
 
G

Genestro

All the Java IDEs seem to suffer from a related problem: if one is left
open and idle for a while, it freezes and gets reported by the OS as
"not responding" for a significant time (usually several full minutes)
if you then switch to it and try to start using it again.

Eclipse and Netbeans, in particular, are both guilty of this behavior.
Even the "lightweight" Clojure IDE clooj does it (worse, it sometimes
*crashes* if it was minimized -- it will grind for a while not
responding, and then instead of becoming responsive it may instead just
disappear without so much as a word of explanation. If you look in the
jar's directory, however, there'll be a file there with a name like
hs_err_pid7004.log saying something like

#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d0b6b30, pid=7004,
tid=7040
#
# JRE version: 6.0_24-b07
# Java VM: Java HotSpot(TM) Client VM (19.1-b02 mixed mode, sharing
windows-x86 )
# Problematic frame:
# C [awt.dll+0xb6b30]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

--------------- T H R E A D ---------------

Current thread (0x05062800): JavaThread "AWT-Windows" daemon
[_thread_in_native, id=7040, stack(0x05750000,0x057a0000)]

and then a bunch of miscellaneous junk. The details will vary depending
on JVM version and operating system, but it seems to be a bug in AWT
provoked by deminimizing a Frame.

To my knowledge, Eclipse and Netbeans don't share this problem, but do
share the hang-on-suddenly-being-focused-after-having-been-idle bug. The
clooj crashes also never occur if it was not minimized but just left
idle, though the hang still occurs. If it was minimized, the hang may be
followed by the crash or by the application becoming responsive again,
seemingly at random.

All of the hangs show a low level of CPU use and a low level of I/O use
in ps/tops/etc. type tools (or ProcessExplorer, on Windows). So it's not
a busy-loop or heavy I/O making it unresponsive; instead the profile of
CPU/IO use is more like what you'd expect if the EDT was blocked on a
monitor waiting for a lock to be released somewhere. Possibly another
AWT bug, then -- in which case it may be endemic to any GUI app coded in
Java.

Since Swing apps (clooj, NetBeans) and SWT apps (Eclipse) both exhibit
the problem, the problem is likely to exist at the AWT level (or lower)
rather than in either Swing or SWT.

The OP's problem sounds like it could be yet another variation on the
theme, but this time with high CPU use. I'd suspect possibly a
misbehaving plugin since it doesn't happen to all Eclipse users.
 
M

markspace

All the Java IDEs seem to suffer from a related problem: if one is left
open and idle for a while, it freezes ....

Eclipse and Netbeans, in particular, are both guilty of this behavior.


I use NetBeans and I haven't seen this behavior. Maybe we have
different definitions of "a long time" (mine is "eight hours or more")
but perhaps also it is something local to your installation.
 
E

Eric Sosman

All the Java IDEs seem to suffer from a related problem: if one is left
open and idle for a while, it freezes and gets reported by the OS as
"not responding" for a significant time (usually several full minutes)
if you then switch to it and try to start using it again.

Eclipse and Netbeans, in particular, are both guilty of this behavior.
[...]

Strange. I've used NetBeans since the 3.x days (that is, since
before it was usable) and am now using 6.8 (I dislike 7.x), and have
never seen what you report, nor anything like it. I've also used
Eclipse some (although only on Linux, and not nearly as much), and
have not observed anything along those lines. I imagine there must
be something rather different in our environments, but I don't have
any idea what it could be.

The O.P.'s report sounds a bit different from yours, though: He
mentions delays when firing up Eclipse the first time after not using
it for "one or two weeks," and doesn't say anything about letting it
sit open but idle, or about switching tasks. The "one or two weeks"
aspect made me wonder about auto-update or auto-patch activities, or
maybe about auto-resync with a version management system that's been
absorbing a lot of changes while he was away (so maybe there's a lot
of metadata to catch up on). But I'm dubious about that hypothesis,
since it doesn't square well with his report of high CPU activity --
fetching a lot of updates or metadata might take half an hour over a
slow network, but shouldn't peg the CPU ...

"Is a puzzlement!"
 
Z

zyng

Thank you all for your replies. I realized that this problem is most likely due to Subclipse so I posted it in Subversion usergroup. Somebody replied and suggested me to use new version Subclipse, saying it solves a problem which I described.

It is hard for me to test if the problem has been solved since it needs me not using Eclipse for one or two weeks. So I assume this is the answer to the problem.

Thank you again for all your help. I did see a file hs_err_pid7004.log sitting in my home directory and I was always wondering where this file came from and what for. Now, I have a better understanding of it.
 
A

Arne Vajhøj

All the Java IDEs seem to suffer from a related problem: if one is left
open and idle for a while, it freezes and gets reported by the OS as
"not responding" for a significant time (usually several full minutes)
if you then switch to it and try to start using it again.

Eclipse and Netbeans, in particular, are both guilty of this behavior.

I have never seen it.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top