JVM Debugger Memory View for IntelliJ IDEA

Every day we try to find new ways to improve developer experience with IntelliJ IDEA. It may be a bugfix, a performance improvement, or a new feature (usually in this order). Today we’d like to introduce a new plugin called JVM Debugger Memory View.

The plugin extends the built-in debugger with capabilities to explore objects in the JVM heap during a debug session. The Memory View shows you the total number of objects in the heap grouped by their class name.

To open the tool window, use the main menu: ViewTool WindowsMemory View.

memory_analyzer_2

When you’re stepping over the code, the Diff column shows how the number of objects changes between debugger stops. This way you can easily see how the code you’re stepping over affects the heap.

A double click on a class name, opens a dialog with instances of this class.

memory_analyzer_1

The dialog lets you filter instances by an evaluated expression. All debugger operations such as Inspect, Mark Object, Evaluate Expression, Add to Watches, etc can be applied to instances in this dialog.

To install the plugin, open Settings Plugins, click Install JetBrains plugin and search for “JVM Debugger Memory View”.

UPDATE: The plugin is now available for IntelliJ IDEA 2016.1 and Android studio 2.2.

Found a bug or miss a feature? Your feedback is very welcome in the issue tracker.

Develop with Pleasure!

About Andrey Cheptsov

Part-time dreamer. JVM/JavaScript geek. IntelliJIDEA Marketing Manager at JetBrains.
This entry was posted in Featured Plugins, New Features and tagged . Bookmark the permalink.

36 Responses to JVM Debugger Memory View for IntelliJ IDEA

  1. A Dev says:

    Please split screen in the Run and Terminal menu, it’ll make debugging client and server easier

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

  2. nithin says:

    couldn’t find the plugin, is it not available on community edition?

  3. Frederic says:

    Is the diff column per thread?!
    For example I stop for some break point, is there a way to know allocated object for my current thread only?

    Or maybe: do we have a way to filter diff object with a rule?

    • Vitaliy Bibaev says:

      Frederic, no, the ‘Diff’ column is one per JVM.
      Currently, there is no way to see objects allocated from the current thread only.
      Thanks for you questions.

  4. Daniel says:

    I must be missing something obvious but I cannot figure out how to open the Memory View window. I installed the plugin. IntelliJ says that it is installed and enabled when I check using the Plugins section of the Settings window. I set a breakpoint in a fairly simple app at a point where there should be at least a few interesting things allocated and launched the app within the IDEA debugger. I’m now at the breakpoint and I simply cannot see _anything_ that lets me launch the Memory View window.

    My Mac is is running Mac OS X El Capitan 10.11.6. The “About IntelliJIDEA” window reports

    Any idea what’s going wrong or what I’m missing?

    IntelliJ IDEA 2016.2.2
    Build #IU-162.1628.40, built on August 16, 2016
    Licensed to Daniel Boulet
    Subscription is active until December 30, 2016
    JRE: 1.8.0_76-release-b216 x86_64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

    • Alex says:

      I have just the same issue, no Memory view.
      http://imgur.com/a/RNfaN
      OSX El Capitan 10.11.6
      http://imgur.com/a/0k8zz

    • Ben says:

      I am experiencing the same problem. I have installed the plugin and restarted the computer (just to make sure) and when I hit a stop point I don’t see anything to indicate memory. Everything looks like it used too.

      IntelliJ IDEA 2016.2.2
      Build #IU-162.1628.40, built on August 16, 2016
      Licensed to ##### / Ben #####
      You have perpetual fallback license for this version
      Subscription is active until November 20, 2016
      JRE: 1.8.0_45-b15 amd64
      JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

    • john says:

      There is nothing here either. Running Linux Mint 17.3 cinnamon 2.8.8

      IntelliJ IDEA 2016.2.2
      Build #IU-162.1628.40, built on August 16, 2016
      Licensed to xxxxxxxxxxxxxxxxxxx
      Subscription is active until February 8, 2017
      JRE: 1.8.0_76-release-b216 amd64
      JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

    • Vitaliy Bibaev says:

      Discussion of this problem: https://youtrack.jetbrains.com/issue/IDEA-160078
      Summary: need to open “Memory view” tool window. (View | Tool Windows | Memory View)

  5. Matt says:

    How come java.lang. successfully filters and shows all the objects in java.lang , but once you type java.lang.S (if you were trying to show java.lang.String instances, for example) all the results disappear?

    Anyways, this is pretty cool.

  6. Nico says:

    Is there any chance to get this for other platforms too? I’d love to see it for PHP!

  7. popalka says:

    [82552352] WARN – openapi.wm.impl.ToolWindowImpl – ToolWindow icons should be 13×13. Please fix ToolWindow (ID: Memory View) or icon file:/home/ar/.IntelliJIdea2016.2/config/plugins/jvm-memory-view/classes/icons/main.png

  8. Kenny says:

    Very cool, is this coming to Android Studio? I’m running version 2.1.3, and I don’t see it when I perform the search under “Install JetBrains plugin…”

    • Vitaliy Bibaev says:

      At the moment, plugin is not available for Android Studio.
      We are planning to release a beta version (with some restrictions) for AS 2.2

  9. Matt S. says:

    Has the plugin been removed due to all of the errors reported? I cannot seem to find it:

    Settings → Plugins, click Install JetBrains plugin and search for “JVM Debugger Memory View”.

  10. Chris Britton says:

    Is there any way to show the shallow and deep (retained) heap usage for each instance?

    Thanks.

    • Vitaliy Bibaev says:

      No.

      Evaluation of the retained size for all instances works dramatically slow through the debugger API. Shallow size without retained is not very useful, therefore the plugin does not provide this feature

  11. Venkat says:

    In the memory view window I could see nothing. My application is running in debug mode

  12. Forrest Barnes says:

    Can other extensions for the built in jvm debugger be developed by non-jetbrains developers?

  13. Vitaliy Bibaev says:

    Yes, everybody can make a plugin which reuses the code of the JVM debugger

  14. Scott S says:

    Would be great to see the actual size of the collections/objects in the Memory View.

  15. Alexandr says:

    couldn’t find the plugin, is it not available on 2017.1.2?

  16. Peter Roth says:

    Is there any way to use this tool to analyze a heap dump taken from another JVM instance that the debugger is not currently connected to? E.g. load a heap dump from a file?

Leave a Reply

Your email address will not be published. Required fields are marked *