Kludgey but effective solution to endless performance woes

Hey all,

I switched to a new company a few weeks ago and have since been pulling my hair out constantly at the horrible, horrible performance RubyMine has been giving me with my company's massive, although fairly well broken up, codebase. It would generally start after starting/stopping rubymine a few times, and then I would notice it sucking the life out of my harddrive while it did absolutely nothing except respond slowly. No it's not indexing, no it's not inspecting, all it's doing at this point is making me slowly die inside. It even got to the point where if I quit RubyMine while it was sludging, when it started back up it would continue sludging exactly where it left off and never stop. This happened many times a day and was extremely embarassing as my apple-wielding coworkers scratched their heads and wondered why I didn't upgrade my IDE.

Since it persisted beyond shutting it down I tried clearing out my ~/.RubyMine20/ directory and letting it recreate it... This made it run like new with no noticable slowdowns in sight, aside from the initial re-indexing. I soon found it was the ~/.RubyMine20/system/ directory that was holding whatever state was causing it to sludge, so this is what I did to fix it as a long term but effective solution:

In a nutshell, the key is that you run this script instead of the rubymine.sh script, the script copies over a clean version of the system folder, then starts rubymine all fresh and new every time without you having to think about it. If rubymine starts slowing down as it inevitably will, just close it and run the script again and you're good to go.

- delete the ~/.RubyMine20/ directory (NOTE: you might want to save your ~/.RubyMine20/config/ if you care about your shortcuts and configurations... you might be able to only delete the system directory, this is just what I did)
- start RubyMine
- open your project as if you were about to start working and wait for RubyMine to settle down
- close RubyMine politely
- cp ~/.RubyMine20/system ~/.RubyMine20/system-clean

drop the attached script in your rubymine_home/bin/ and chmod a+x it... I set it so you have to adjust the script for it to run, put a few comments in there... Be -extremely- careful with it, it contains an rm -rf

Let me know if you have any questions or if the script doesn't make any sense or if you think my method sucks and you do it better, because you probably can.


Does anyone know what the equivalent would be for OS X?


It would be extremely similar, which part are you getting hung up on, the script? Start out by taking out those notify-send lines, they don't do anything except provide pretty little popup notifications (it only takes like 15 seconds anyways, not that necessary) if you're feeling frisky you can get it to work with growl but I don't know the syntax for that.

I think the biggest difference is where the config and system folders would be stored on OSX... I'm a total mac noob so I can't really help you out there, but once you find it I would expect that you just need to change the RUBYMINE_SETTINGS_DIR to point to wherever the root folder is that holds the config and system folders that store your current settings/caches/etc. I -think- shell scripts work about the same in osx but I can't say for sure... Any osx folks want to help out here?


Sorry - I should've been more specific. On my OS X system, there is no such directory, nor environment variable. I'm sure this config information lives somewhere - I just don't know where.


Ok, well as a quick aside, all the environment variables set in that script are intended for the sole use of the script, so feel free to add in your own or rename or remove any you don't need.

Try doing a search for rubymine, case insensitive in your home directory... make sure it's looking in the hidden folders too

In linux this would be: find ~/ -iname "*rubymine*"

I would expect that to work in osx, but otherwise use whatever file searching mechanism it uses.

You should add some echo statements to the script file and run it from the terminal to help you debug once you figure out where the config files are. Lemmie know how it goes.


There's a ~/Library/Caches/RubyMine20 directory that looks promising. I'll try clearing that next time
I see sluggish performance.


Yep, that's got to be it. You could also try clearing just ~/Library/Caches/RubyMine20/system

I'm 90% sure RubyMine would just recreate that, and if it didn't you could just delete the rest of RubyMine20... It just sucks to lose your configuration in ..../RubyMine20/config

Alright, hopefully you won't run into any sluggish performance but let me know how it goes if you do.


Hello John,

Instead of using these strange hacks I recommend you to submit a performance snapshot as described in javascript:;. Which JVM do you use? Is your ~/.RubyMine20 located on a network drive?


Actually it's on an ecryptfs mount, the default encrypted ubuntu setup. I'm sure that added to the problem but it shouldn't be enough overhead to cause it to lock up over and over like it did. I agree that clearing the system folder over and over is ugly, hence the title, but I have to get work done and it lets me do just that. I haven't run into performance issues since I started using this script, but if I do and I'm not on the clock I'll submit a snapshot.


HDD performance is critical for RubyMine caches. I can explain you how to move caches folder to another disk. It's quite easy: actually you need to move only ~/.RubyMine20/system folder to another place. For this open a RUBYMINE_HOME/bin/rubymine.exe.vmoptions file (Windows and Linux, see /Applications/RubyMine-X.X.app/Contents/Info.plist on MacOS) and add the following line at the bottom:


I'm also using encrypted home folder on my Mac but I don't have such performance problems.

Thanks, but I don't want it caching anything out of the encrypted directory. It seems to be doing fine as long as I keep the system directory fresh.


Please sign in to leave a comment.