Rubymine Sucks up CPU
Hello,
I've had several instances where RubyMine sucks up 100% CPU.
It doesn't happen all the time, but when it happens, it doesn't seem to be doing anything visible (indexing or something like that), and the editor really becomes unusable, (ie, type a letter, takes 2-3 seconds to show up on the screen).
I tried do what this document said to:
http://www.jetbrains.net/devnet/docs/DOC-1144
However, when I make the change in the startup script to enable the CPU and Memory snapshot tool...it crashes when I try to start rubymine. I take out the change that the document recommends and it is fine.
I'm using the Beta 2 version 2 rubymine on Mac OS X Leopard.
Any ideas?
thanks,
Mark
Please sign in to leave a comment.
Hello Mark,
Unfortunately your are right our new build script haven't pack necessary library in RM distributive. I've created an issue - http://youtrack.jetbrains.net/issue/RUBY-5185. Which OS do you use? Probably we can attach necessary library to this topic and you will be able to take a snapshot.
Without CPU snapshot it is hard to say anything. Also please take a look on Java Heap usage information
Does first number (used part of heap) and second number(current heap size) almost equal in such situations?
Hello,
my Mac OS is Leopard (NOT snow leopard).
If I do see the used heap is close to the allocated heap (ie, the two numbers are in fact close to each other), is there an action I can take?
Also, what do you consider to be close? (is 57 of 70 close?, looking at your image)
I'm not sure what a good ratio would be....
thanks!
so...I have noticed that my heap used size can get very close to the heap size.
my heap size is set to around 500, and the heap used size can get to 470 or so.
Is there some tweaking I can do to this to make the performance better?
Mark
ok...so another think I've noticed.
It does happen a lot when I run stuff through the debugger.
And yes...my used heap is very close to my available heap.
So...I'm assuming a lot of memory swapping is going on...is there a way to adjust this for better performance?
thanks for your help!!
Mark Blair
Hello Mark,
Thank you for your answers
I've attached missed library to this post, please copy it to /Applicatons/RubyMine 2.0 Beta 2.app/bin and then -agentlib:yjpagent will not crash RubyMine.
With default settings RubyMine increases heap size from 16 up to 512 mb. So if you continuously see something like 511 of 512 or 505 of 512 then most part of CPU time RubyMine is collecting garbage and trying to free some memory. Here two variants are possible:
1. Most likely this have happened due to memory leak of RM and memory snapshot is highly desired (see http://www.jetbrains.net/devnet/docs/DOC-1144)
2. Probably you've opened several large projects in RM simultaneously and RM needs more memory for internal data structures, hashes, etc.
Please take a memory and CPU snapshots
Is suppose it will not help in you case. Because there is no sense in increasing -Xmx (max heap size) option in Info.plist when it isn't really needed (or in case of memory leak bug). Larger heap may lead to longer Java Garbage Collection pauses.
Attachment(s):
libyjpagent.jnilib.zip
Thanks, the library does work and I did get a memory snapshot.
I'm only opening one project...and now the memory goes right to 500 Meg on just opening the project, not actually doing anything.
It has essentially become un-usable for me....because it just pegs the CPU just on opening the project.
I did get a memory snapshot...but I have to be careful...what is in the memory snapshot?
The project I work on is proprietary, I can't send you something that could leak code. Is there a way for me to analyze it myself?
One thing that is interesting to note, we did freeze rails into our vendor directory, I notice that Rubymine spends quite a bit of time at the beginning of opening the project indexing that area, not sure if that has anything to do with it.
thanks!
Mark
As an experiment...I upped the memory to 1024...and it eventually gets all used up.
Although you can use it longer....
It contains RubyMine's caches including content of some source files
These rails gems are necessary for code insight analysis. You can notice that RM automatically adds them to Settings | Ruby SDK and Gems attached gems list and use for navigation/autocompletion. Reindexing starts only on first project opening or after crash.
Ok, let's try. I can explain you how to open this snapshot with profiler and then I'll ask to attach several screen shots which should help to find memory leak
1. Download and install YourKit profiler - http://www.yourkit.com/download/. Your need version 7.5 (http://www.yourkit.com/download/yjp-7.5.11-mac.zip)
2. File | Open Snapshoot...
3. If snapshot 1480.xxxx isn't listed then press "Open Snapsot Not Listed Here.." button, choose "All Files" file format and open snapshot which is located in your home directory
4. Now switch to "Biggest objects (dominators)" and make a screenshot. E.g.
Here are a couple of screen shots.
For this memory dump...I had just started RubyMine with my project open...had not actually done any editing/debugging...the memory jumped to 500.
Attachment(s):
Summary.png
ObjectMemory.png
Any more thoughts on the memory issue?
I'm trying to think of things I've noticed that could be problematic....
I do tend to switch GIT branches using the command line (as opposed to the Ruby Mine GUI), and it does a lot of indexing when I do that (makes sense).
Such indexing shouldn't lead to memory leak. RubyMine reindexes changed files after I've switched branches
any more thoughts on this one? It is still happening....
Hello Mark,
It would really be much more convenient for us to get access to the memory
snapshot itself. While it does contain fragments of your source code, it's
really hard to extract them in a meaningful form (and we really have better
things to do :) )
You don't need to attach the snapshot to a public issue in YouTrack. Instead,
you can upload it to ftp.intellij.net/.uploads (which is write-accessible
to anyone and read-accessible only inside JetBrains), or upload it to a file
sharing site and send a private link to me at yole@jetbrains.com (in which
case I'll only see the snapshot myself).
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I'm still seeing high CPU usage (which consequently results in poor performance) with RubyMine 2.0 Beta 3.
I have just uploaded a CPU snapshot to your FTP site (90.143_lylo_04.11.2009_13.07.57.zip).
I really hope you can fix this, I'm having to resort to TextMate just to get stuff done at the moment.
Olly
Further to this, I find that if I leave RubyMine running (without any active background processes) and put my Mac to sleep, when it wakes up the performance of RubyMine is terrible. I have to restart RubyMine to get this back to normal.
Please take a look at "Page Out" statistics. Probably MacOS pushes RM to swap. I heard that MacOS pushes to swap every application about once a day.
Hi again
I've been having major performance issues again this morning, this time nothing to do with putting the Mac to sleep. I've been using Beta 3 for a couple of hours and now every operation, be it a right-click, opening a class etc, just takes forever!
I've uploaded another CPU snapshot -- 90.143_lylo_06.11.2009_11.50.22.zip.
Please make RubyMine speedy again, please!! Performance is WAY more important than any new features right now, seriously.
Thanks,
Olly
Hi Olly,
After we had looked through your snapshots we've got several questions: what OS and Java versions do you use? Have you updated your environment recently?
Have you option File | Settings | Editor | Code Completion | Autopopup | After dot enabled? Probably turning it off will help.
Regards,
Oleg
Hi Oleg
OSX 10.6.1
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)
I've turned off the dot setting just now, I'll see if that helps.
Olly
Yet another question: was the latest snapshot captured right after RubyMine started or after some time?
After around an hour
Still happening with the new Release Candidate.
It seems to be particularly bad after running a lot of Shoulda tests. E.g. lots of right clicking on should "something something" blocks to run that test fragment, interspersed with running the entire test.
I've also noticed that the RAM figure in the bottom right is maxed out at 500MB. Is this a memory issue? My machine has 3GB RAM so I would hope not. That said, restarting RubyMine makes the problem go away, for a while at least.
I really hope you can help, I'm immensely frustrated with this.
Olly
Probably it is a memory leak in RM and most part of CPU time RM spends on garbage collection. Please take a memory snapshot and upload on our ftp.
RM isn't allowed to use all you RAM. Actually max heap size bound is 512 mb, but it should be enough for most cases. How many projects are opened simultaneously in RubyMine ? Are they big? (e.g. quantity of models/controllers files)
Thank you for your patience!
Just had a spike: uploaded as 90.179_lylo_10.11.2009_11.03.44.zip. It's pretty large, hope I don't have to do that too often
Hope you can fix it!
Thank you for the snapshot. Due to it we've found and almost fixed several performance problems in RubyMine.
Wow! That sounds fantastic! :-) Let me know if you need any more snapshots
Olly
Wow...that sounds promising.
Sorry I wasn't able to give you a snapshot. I asked for but was denied permission to send it to you, the company is paranoid security wise.
Thanks for uploading your Olly, hopefully these issues will be addressed. I love working with RubyMine.
Could you please test a new RC build that we've just uploaded? http://download.jetbrains.com/idea/rubymine90.192.dmg
This is a big improvement on all previous post 1.1 releases! I'll keep monitoring it and send over any mem/CPU dumps if necessary
Thanks a lot!
I spoke too soon. Getting massive CPU spikes again in the last hours. I've uploaded 5 CPU snapshots and one memory snapshot, plus I've 'blamed rubymine core' a few times due to IDE errors. I hope you can find and solve more bugs from this!