#9684 7 second lock-up when switching to IDEA

I have noticed that, on all IDEA 8 versions, when I switch away from IDEA to another application, IDEA CPU usage rises to 50% for about 7 seconds. During this period, the IDEA IDE is unresponsive if you switch back to it. This means that switching to another application then immediately switching back to IDEA (for example, after checking a document or browser) always incurs a 7 second delay. This can be incredibly frustrating.

I have added a comment to this effect to the tracker for "100% CPU usage when focus moves back to IDEA" (http://www.jetbrains.net/jira/browse/IDEA-19066), but I'm not sure it is exactly the same problem.

I notice that when I switch to a smaller test project, this doesn't occur.

I'm running a largish project under Windows XP Pro. Does anyone else experience this problem?

23 comments
Comment actions Permalink

Hello Dave,

What happens during this time is saving of settings, project and module files.
You can file a JIRA issue with the snapshot attached so that we could see
if there's anything in this process which takes excessively long, but in
general it's normal for this process to take a couple of seconds.

I have noticed that, on all IDEA 8 versions, when I switch away from
IDEA to another application, IDEA CPU usage rises to 50% for about 7
seconds. During this period, the IDEA IDE is unresponsive if you
switch back to it. This means that switching to another application
then immediately switching ba

ck to IDEA (for example, after checking a document or browser) always
incurs a 7 second delay. This can be incredibly frustrating.

I have added a comment to this effect to the tracker for "100% CPU
usage when focus moves back to IDEA"
(http://www.jetbrains.net/jira/browse/IDEA-19066), but I'm not sure it
is exactly the same problem.

I notice that when I switch to a smaller test project, this doesn't
occur.

I'm running a largish project under Windows XP Pro. Does anyone else
experience this problem?

---
Original message URL:
http://www.jetbrains.net/devnet/message/5231075#5231075

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

I wouldn't mind a couple of seconds so much, but 7 seconds is at least 5 seconds too long ;-)

If you were asking for a memory or CPU snapshot, I obviously can't take one while IDEA is unresponsive, so would it be better to take one before or after the lock-out?

0
Comment actions Permalink

Hello Dave,

I wouldn't mind a couple of seconds so much, but 7 seconds is at least
5 seconds too long ;)

If you were asking for a memory or CPU snapshot, I obviously can't
take one while IDEA is unresponsive, so would it be better to take one
before or after the lock-out?


Start recording the CPU snapshot, switch to another app, switch back, wait
for IDEA to become responsive again and stop recording.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

OK, I'll give it a try...

0
Comment actions Permalink

I am having the same issue (5 to 7 seconds each time I switch to another app) and my project is not that large. To the point where it makes this version of IDEA really hard to use.
It was working perfectly 2 EAP release ago.

Aymeric.

0
Comment actions Permalink

Hello Aymeric,

I am having the same issue (5 to 7 seconds each time I switch to
another app) and my project is not that large. To the point where it
makes this version of IDEA really hard to use.

It was working perfectly 2 EAP release ago.


One possible reason is the IDEA Server plugin. You should disable it if you
aren't using the settings sharing functionality.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

I have seen this problem happen when my project files had grown to some unacceptably large size. The .ipr file had grown to a couple of megabytes because of some plugin. Editing the project file by hand and removing the one large and unneeded xml element, improved matters immensely.

Bas

0
Comment actions Permalink

I have the IDEA server disabled.

I did reinstall previous EAP versions of IDEA as this issue makes it really hard to work for me.
Both EAP 9684 and 9678 have a 5-7 seconds pause when switching to other apps.
EAP 9647 works great, the pause is about one second and barely noticeable.

==> Bas Leijdekkers: My project is fairly small and the ipr amd iml file are less than 60k, so that's probably not the issue here. Thanks for the input.

Aymeric.

0
Comment actions Permalink

Hello Aymeric,

I have the IDEA server disabled.

I did reinstall previous EAP versions of IDEA as this issue makes it
really hard to work for me.
Both EAP 9684 and 9678 have a 5-7 seconds pause when switching to
other apps.
EAP 9647 works great, the pause is about one second and barely
noticeable.


Please take a CPU snapshot (start recording, switch to another app, switch
back, wait for IDEA to become responsive, stop recording) and file a JIRA
issue with the snapshot attached.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

OK - apologies for the delay, but I've now uploaded a CPU snapshot to the ftp.intellij.net uploads directory.

It is called 9684_dlorde_03.02.2009_10.09.12.zip.

0
Comment actions Permalink

For those getting this but not watching the JIRA item, I found that
ensuring I had a minimum number of unversioned files in my changes
window seemed to help. Also the IDETalk plugin might be causing
problems. More in the JIRA: http://www.jetbrains.net/jira/browse/IDEA-19066

N.

0
Comment actions Permalink

Thanks for the heads-up on that Nathan - I only have 2 unversioned files in the Changes panel, but I do have 21 directories and 11 files in the 'Locally Deleted Files' change list. That could be a lot of files, but I don't understand why they're there - all those directories & files are still active in CVS, and are still present and used locally. I'm beginning to think they are a likely cause of the problem, but if I try to remove them from the change list, it asks if I want to delete them from CVS, and I most definitely don't want to do that...

0
Comment actions Permalink

Hi Dave,

can you observere huge memory changes in the lower right of Idea right after the window does get responsive again? I have similar problems like you but in a Linux environment. As a possibility I think this is related to the Java memory management (Garbage collector).

Thomas

0
Comment actions Permalink

I just installed version 8.1, and it behaves the same way. If I do a garbage collection before switching to another application, the heap indicator shows about 255M. When I switch back to IDEA, it freezes until the 7 seconds has elapsed (since switching away from it) and then the heap indicator jumps to about 485M. So, yes, there is a change in the indicated memory use, but I am told that the heap indicator is not a very accurate indication of memory use...

The cause could be any number of things, but Dmitry says "What happens during this time is saving of settings, project and module files". What I don't understand is why the delay consistent whether anything has been changed or not - surely IDEA only needs to save settings, project and module files when some change has been made (and even then it only need save the items that have changed). Why does this 7 second freeze occur even when nothing has been changed?

8.1 also takes over 30 secs to quit, whether anything has been changed or not.

0
Comment actions Permalink

Hello Dave,

I believe it is only a very small possibility, but for me the plugin "CVS Toolbar" did do some performance problems. But I did not track down very carefully and don't want to blame anyone here. You could try to deactivate all plugin you did install yourself and probably all others you do not need as well. But all this is just a guess. I think you should beg support for a quick response on the snapshot analysis.
What else you could do in the meantime:

- plugin deactivation (deactivate all and activate again one by one)
- analyze the cpu snapshot with yjp by your own
- analyze idea logging output, see bin/log4j.xml for details
- adjust your memory settings as suggested in much places
- check generic Java performance of you system with other applications or IDEs

Idea: Is there a top ten FAQ already regarding performance? I would suggest you link it to http://www.jetbrains.net/devnet/docs/DOC-192. There are a lot of night shots all around in the web, if you understand what I mean.

Regards
Thomas

0
Comment actions Permalink

Thanks for the suggestions Thomas.

I'll try them when I get some time, although I can't adjust the memory settings - any less and IDEA gives 'Out of Memory' errors, any more and it won't even start up.

0
Comment actions Permalink

I tried removing all non-default plug-ins, and it made no difference.

The problem doesn't occur on a small test project.

I really don't see why any significant activity is necessary when switching to and from IDEA, if nothing in the project has changed.

0
Comment actions Permalink

I created an issue (http://www.jetbrains.net/jira/browse/IDEA-21768) 2 weeks ago with a CPU snapshot. I still didn't hear anything back from Jetbrains support.
I was hoping someone could look at the snapshot and at least tell us if this is related to a particular plugin. So that we know if we can do anything on our side to solve the slowness.
JetBrains advertises 8.1 as a major step forward in performance. My experience so far is that the CPU usage is maxed out most of the time.
Give me back the poor performances of the previous version and I will be happy again.

Aymeric

0
Comment actions Permalink

OK, I voted for it.

I've also tried turning of file synchronization on activation and file save on deactivation, but it made no difference.

0
Comment actions Permalink

Success! Looks like I've answered my own problem - the delay appears to be proportional to the number of schemas and tables loaded from the data source. Every table column(field) has a 10 line entry in the .ipr project file, causing it to swell enormously - in my case to nearly 30MB

By restricting the data source loading to only the essential minimum number of schemas and tables I need for any particular task, I can reduce the .ipr file size to under 5 MB and the delay to between one and two seconds at worst.

This suggests that the .ipr project file is being saved every time IDEA loses focus to another application, causing the delay. I don't understand why this happens even when nothing has changed, but presumably it isn't a problem for small .ipr project files. It seems to me that storing the current datasource configuration in the .ipr file is not an ideal solution, as it only changes occasionally and then only via the Data Source Properties dialog, at which time the new configuration can be saved. I can't see that it ever needs to be saved at any other time. Perhaps storing the data source configuration in a separate file would be a more efficient solution?

However, if the .ipr file is to be loaded with everything, including the kitchen sink data source config, it would seem sensible to check for modifications to the relevant elements being stored before writing the file. This would still mean an unnecessary delay when some other project element changes, but it would be much less frequent.

If I have misdiagnosed the problem, I'm sure Dmitry will put me right, but meantime I'm productive again

0
Comment actions Permalink

Dave,

Same thing here, with a slight variation.
My .ipr file is only a few Kb large. I defined a datasource at the 'Global' level and in that case, IDEA creates separate file to store the datasource information (12 Mb).
Once I removed that file, everything started working fast again.

Thanks a lot for solving the issue. I can be productive again.

Aymeric

0
Comment actions Permalink

So even if the datasource config is a separate file and it hasn't changed, IDEA rewrites it to disk anyway? That seems just wasteful...

It would be nice to see some comment from JetBrains on this.

Anyway, I'm glad your problem is sorted as well

0
Comment actions Permalink

Thank's a lot!
May be your solution save me from migration to Netbeans or smth else

0

Please sign in to leave a comment.