Knowledge Base/Troubleshooting

Reporting performance problems

Serge Baranov
posted this on November 25, 2013, 14:08

IDE hangs and doesn't respond

Please refer to this document for reporting the problems when IDE is completely frozen and doesn't respond to any actions for a long time.

If you can continue working with the IDE, but it feels slower than expected, CPU usage is high or there is a memory leak, read below.

Enabling Profiler Agent

Windows/Mac

Profiler agent is enabled by default in EAP builds, to enable it in the release builds do the following:

  1. Locate the .vmoptions file for your product (Mac OS users: don't forget to make a copy of the original file to ~/Library/Preferences/<product> and edit this copy instead).
  2. At the end of the .vmoptions file add the following line:
-agentlib:yjpagent=delay=10000

Windows users running under 64-bit JVM and editing <product>64.vmoptions file should use this line instead:

-agentlib:yjpagent64=delay=10000

Linux

Linux users can utilize an alternative way to enable profiler: edit bin/<product>.sh startup script and change IS_EAP="false" to IS_EAP="true".

Agent library name on Linux is different, if you choose to modify the .vmoptions file, use the following: 

-agentlib:yjpagent-linux=delay=10000

or this for the 64-bit systems:

-agentlib:yjpagent-linux64=delay=10000

 

IntelliJ IDEA and PyCharm Community Editions do not include a YourKit profiler agent, because the YourKit agent library is not open-source. To take a CPU or memory snapshot with the Community Edition, you can download an evaluation version of YourKit Java Profiler, copy the yjpagent library to the IDE bin directory, add it to the .vmoptions as described above, and connect to the running IDE instance from the standalone YourKit Profiler UI.

 

Capturing Snapshots

After restarting the IDE you should see two new items under the Tools menu: Start CPU Usage Profiling and Capture Memory Snapshot.

CPU Snapshot

To provide an informative CPU snapshot you should click on Start CPU Usage Profiling and then perform the actions which are causing performance problems, try to reproduce the performance problem several times while the snapshot is being recorded, then click on the Tools | Stop CPU Usage Profiling and save the snapshot file. When reporting the problem, please make sure to describe what you were doing in detail.

CPU Snapshot with Invocation Counts

When asked to provide a snapshot with the invocation counts, in addition to the -agentlib... option please also add the following into the .vmoptions file:

-Dprofile.trace=true

Make sure there is no disabletracing option in the -agentlib... line, use the options string from the Enabling Profiling Agent section of this document.

Restart your IDE and capture the CPU snapshot from the Tools menu or using the toolbar button.

Memory Snapshot

If the problem you are reporting is related to the heavy memory usage and frequent garbage collection, while increasing the heap size doesn't help, use the Capture Memory Snapshot menu item. To capture automatic memory snapshots when IDE runs out of memory, add -XX:+HeapDumpOnOutOfMemoryError into .vmoptions file. Please note, that memory snapshot may contain the sensitive source code from your project.

Thread Dumps

When IDE hangs and doesn't respond so that you can't use the menu to capture the snapshot, please provide the thread dumps.

 Profiling Slow Startup

To profile slow startup by automatically enabling CPU snapshot recording right after IDE is started, please use the sampling option:

-agentlib:yjpagent=sampling

 Adjust this line depending on the OS and the JDK (32-bit/64-bit, see in Help | About). Please check the Enabling Profiler Agent section above. You just need to replace "delay=10000" option with the "sampling" option.

CPU snapshot file will be saved automatically after your close the IDE into your HOME directory under Snapshots subdirectory and will have .snapshot extension.

Uploading Snapshots to JetBrains FTP Server

If your snapshot is smaller than 10MB, it's fine to attach directly to support tickets or YouTrack issues. Otherwise, please use http://uploads.jetbrains.com/ or FTP:

After you've saved the snapshot, please upload it to our FTP server: ftp://ftp.intellij.net/.uploads/ (anonymous login, .uploads directory has no permissions to list/download files, only for upload, so that other users will not be able to download your snapshots). Inform JetBrains developers via YouTrack performance problem report about the uploaded file and provide its name (or send this file name to the Support Team via the ticket).

If you can't use FTP, upload the snapshot at http://uploads.jetbrains.com/ or use some file sharing service, like Dropbox, Google Drive, etc. and send us the link.

 

Comments

User photo
Michael Hirsch

 This line no longer works on 64 bit linux:

      -agentlib:yjpagent64=delay=10000

The line that works is

     -agentlib:yjpagent-linux64=delay=10000

The new line is needed since at least idea-IU-117.798.  The name of the library is now libyjpagent-linux64.so.

February 13, 2014, 21:29
User photo
Serge Baranov
JetBrains

Michael Hirsch, thanks for the correction, I've updated the document.

February 13, 2014, 22:03
User photo
Johnwlockwood

I'm seeing hanging too, with pycharm maxing the CPU for about a minute when it happens, which seems to be when I open a contextual menu.

June 12, 2014, 02:13
User photo
Ryan

I am also seeing hanging in pycharm 3.4 when using the contextual menu. Should I submit some Snapshots?

June 27, 2014, 06:11
User photo
Alex Baumgertner
February 6, 2015, 17:27
User photo
Ccandido

I have 8.03 on Windows and cannot save my CPU Snapshot. After I click Stop CPU Usage Profiling there is no way to save the snapshot file. 

 

March 11, 2015, 20:07
User photo
Serge Baranov
JetBrains

Snapshots are now saved automatically and you should see a notification about that with a link to open the folder where it's stored:

2015-03-12_01-32-12_1_.png

 

March 12, 2015, 01:34
User photo
Ccandido

Thanks Serge - I also needed to turn Profiler notifications on (they're disabled by default). I got it now though. 

March 12, 2015, 17:31
User photo
Edawebdesign

I tried to run CPU profiler in webstorm 10 EAP but there is no option for Start CPU Usage Profiling

March 18, 2015, 18:50
User photo
Moe1234512345

How do you disable the profiler if it is on by defautl? I am having performance problem and want to try to turn this part off.

March 24, 2015, 21:11
User photo
Serge Baranov
JetBrains

Remove this line from the .vmoptions file

-agentlib:...
March 24, 2015, 21:12
User photo
Moe1234512345

@Serge I am running an EAP .. i figured it out by going into idea.sh and setting is_eap to false

March 24, 2015, 21:15
User photo
Zack Macomber

I'm unable to edit idea64.exe.vmoptions on my Windows machine...seems there's some process that's using it and not allowing me to edit it.  I've closed completely out of IntelliJ IDEA and still can't edit it.

March 27, 2015, 20:34
User photo
Serge Baranov
JetBrains

Run your editor as Administrator, then open the file and edit it, otherwise UAC will not allow to edit files under Program Files folder for regular users.

March 27, 2015, 21:06
User photo
Zack Macomber

I'm such a dummy...just got a coffee so that will hopefully help my brain work!  It is annoying that I'm running as an Admin on my PC and yet I have to grant the User group permission to modify the file...all set now...thanks.

March 27, 2015, 21:40
User photo
Geoff Groos

IntelliJ is very aggressive about toString()'ing things in the debugger, and when I disabled the cache on my database to try to slim-down our memory profile, boy did that get me in trouble. Specifically, I'm using MapDB which (as the name implies) has databases that interface as java.util.map objects. As such a `mapDBStoreObjectThatsInstanceOfMap.size()` call, when the database isnt caching, will take a really long time.

Any chance there's a @Debugger(ignoreField = true) annotation I could put on this field or something similar?

Better yet, If I could make a feature request, it would be that whatever code is evaluating the toString of these things in the environment, does so on another thread with liberal use of timeouts.

April 30, 2015, 00:26
User photo
sam san

I have webstorm 10.0.2 the latest version of web storm. Some how my CSS auto complete does not work. I can't see the auto complete of my bootstrap css and my custom css. I just recognize only html and javascript.  In webstorm version 8 is working perfectly fine. When I download the new version of webstorm, it won't work any more. What should I do?

April 30, 2015, 23:31
User photo
Serge Baranov
JetBrains

Sam, please submit a ticket to support with idea.log (https://intellij-support.jetbrains.com/entries/23352446).

April 30, 2015, 23:33
User photo
Emil Pennlöv

Hi Serge, 

In: Library/Preferences/

I had no WebStorm folder so I created one and copied the webstorm.vmoptions file to that location.

Restarted webstorm.

I was supposed to get the tools "Start CPU Usage Profiling and Capture Memory Snapshot".
I only have "capture memory snapshot" which was present from the beginning.

Thanks / E

May 13, 2015, 12:29
User photo
Serge Baranov
JetBrains

You are looking in a wrong folder, search for the existing one, it's under ~/Library/Preferences, not /Library/Preferences. ~ stands for /Users/<user name>, so the actual folder is under /Users/<user name>/Library/Preferences.

May 13, 2015, 14:35
User photo
Martin Macak

Is it possible to capture CPU Snapshot automatically? I am requested to do so but I am unable to save snapshot because IntelliJ will hang indefinitely once the issue happens.

May 22, 2015, 11:14
User photo
Serge Baranov
JetBrains

Martin, in such cases you should provide a thread dump instead: https://intellij-support.jetbrains.com/entries/23348667 .

May 23, 2015, 09:18
User photo
Norberto Ortiz

This IDE is the black sheep of the JetBrains family. I have a super-powerful computer and the Webstorm stumbles like a cow in a bucket.

June 8, 2015, 22:49
User photo
Mikko Ohtamaa

The instructions to locate vmoptions file can be found here:

 

https://www.jetbrains.com/pycharm/help/tuning-pycharm.html

June 29, 2015, 22:29
User photo
Mickey Mouse

http://i.imgur.com/mPer0nQ.png

Всего один день поработал

OSX ws 10

иии Какая жэ это легковесная иде по вашему ?

Предлагаю заменить вам слоган на всём сайте убрав из него слово lightweight https://i.imgur.com/2QTOixc.png 

July 3, 2015, 20:05
User photo
Mickey Mouse

Serge Baranov, хочешь я тебе предоставлю дамп потока ? :)

 

July 3, 2015, 20:08
User photo
Serge Baranov
JetBrains

Please submit a ticket to support with a memory snapshot.

July 3, 2015, 20:13
User photo
Mickey Mouse

Serge Baranov

это невозможно. Потомучто 

1) я на работе, и здесь исходящий трафик не бесплатный

2) 40 гигабайт я буду заливать пол года

3) Будто бы вы сами не знаете о своих утечках памяти. Вот сами и сделайте себе тикет, и сами его решите.

July 3, 2015, 20:24