Changes in version 9.5 from 9.0:


See also changes in:   9.5.x builds   11   10   9.0   8.0

New Feature: Attach Mode

  • New feature: agent attach mode, i.e. an ability to profile Java applications started without the profiler agent.

    Previously, to profile a Java application it was required to start it with the profiler agent using IDE integration, J2EE integration or manually specifying appropriate JVM option -agentpath/-agentlib.

    Now it is possible to profile Java applications started without that option, attaching the profiler agent to a running JVM instance on demand.

    The agent can be attached to a locally running application from the Welcome screen...

    ...as well as to a remote application with the help of remote attach wizard

    This approach simplifies profiling, making it even more "on-demand profiling" than ever. It allows to avoid special step to enable profiling: any running Java application can be profiled.

    Unfortunately, the attach mode is not an ultimate solution: the existing JVMs provide only limited set of profiling capabilities for the attached agents. To get all profiling capabilities, you still have to start the profiled application with the profiler agent instead.

    Read more...


Memory Profiling

  • Improvement: behavior on memory snapshot loading has changed: weak, soft and finalizer queue references are not nulled by default. All live objects, even those accessible by only weak, soft or final queue references, are treated as live.

    Now you can choose objects of which reachability scope to analyse after opening the snapshot in UI (see below for detail).

    Why has the behavior been changed?

    Previous default behavior - to treat all non-strong references as nulls - was introduced in the very first version of YourKit Java Profiler, and its intention was to simplify memory leak detection and help you focus on the real, "strong referenced" problems.

    However, there were many users confused by "missing" objects, and "mismatch" in sizes shown in memory usage telemetry graph and memory snapshots views.

    Also, to analyse size of data structures such as soft/weak maps, it was required to explicitly instruct the profiler to keep weak/soft references, via properties -Dyjp.keep.weak.refs=true and/or -Dyjp.keep.soft.refs=true in yjp.ini. Changing the settings required to re-load the snapshot and rebuild its index file.

    We believe that the new behavior addresses all the issues:

    • all live objects are visible "out-of-the-box" when opening a memory snapshot
    • when detecting a memory leak, only strong-reference paths are shown by default
    • analysis of soft/weak map sizes and similar data structures is available "out-of-the-box"
  • New feature: Paths to GC roots view has an option (active by default) to ignore paths through weak, soft and finalizer queue references:

  • New feature: objects view has new section Reachability scopes which distributes objects depending on how/whether they are reachable from GC roots:

    • Strong reachable: objects reachable from GC roots via at least one strong reference, or being GC roots themselves. Such objects will not be garbage collected until all strong references to them are nulled and/or they remain GC roots. Thus, memory leaks should be searched among them.
    • Weak/soft reachable: objects reachable from GC roots via weak and/or soft references only. Such objects can be deleted by garbage collector when it decides to free some memory. Such objects are not memory leaks, but they may deserve attention when you analyse memory consumption.
    • Dead objects: unreachable from GC roots, but not yet collected. Once garbage collector decides to delete them, they will be deleted. Objects of classes overriding Object.finalize() will be placed to the finalizer queue before actual deletion.
    • Objects pending finalization: objects in the finalizer queue.

    In addition to the "Reachability scopes", objects view's header shows brief summary on the number of strong reachable objects, and if there are any, provides an easy way to open them in new tab in one click (useful when analysing memory leaks):

    Action "Memory | Instances by Class... (Ctrl+N)" allows to choose reachability scope of objects to open:

    The reachability scope for individual objects is shown in reference explorers and paths views:

    Snapshot comparison allows to choose reachability scope of objects to be included to the comparison results:

  • New feature: new metrics "Distance to nearest GC root" is shown in Quick info for individual objects
  • New feature: new memory inspection Objects with biggest distance to nearest GC root helps finding longest chains of objects such as linked lists, queues, trees etc.
  • New feature: new memory inspection HashMap hash code distribution helps finding maps with bad performance due to hash collisions
  • New feature: new memory inspection Duplicate Arrays finds potential memory waste
  • New feature: ability to capture HPROF snapshots with JVM built-in dumper is now also available for applications running on JRockit R28.0.0 and newer
  • New feature: HPROF snapshots: thread stacks at the moment of snapshot capture are shown in "Threads" tab (if available). Also, for each thread are shown its name, status and tid, as well as daemon threads are indicated. Note: if there are index files created via earlier builds of the profiler, please delete or re-create them; otherwise stacks will not be shown.
  • Improvement: object size calculation is supported for HPROF snapshots of JVMs running in the compressed pointer mode (JVM option -XX:+UseCompressedOops).

    In this mode, JVM runs as a 64-bit process, but object references stored in heap are 32-bit instead of full 64-bit, which saves memory and helps CPU cache in its work.

    HPROF files do not explicitly contain object size information, so the profiler calculates them basing on object field types and array sizes. In case of a 64-bit snapshot, it has to know whether -XX:+UseCompressedOops was used, to detect object reference size - 4 bytes or 8 bytes. Unfortunately, this information cannot be automatically retrieved from the HPROF file.

    When a 64-bit HPROF snapshot is about to open, you will be asked to choose what kind of snapshot it is.

    When opening snapshots via API or when performing offline snapshot indexing, please use -Dyjp.hprof.compressed.oops=true or -Dyjp.hprof.compressed.oops=false (default).

  • Improvement: more accurate size calculation for some arrays in HPROF snapshots
  • Improvement: first elements of primitive arrays are immediately shown in object explorers
  • Improvement: default number of array elements shown in object explorer (20) can be changed adding -Dyjp.array.elements.to.show=value in <Profiler Installation Directory>/bin/yjp.ini However, note that showing too many elements can make the UI slower when browsing big arrays.
  • Improvement: if Class hierarchy is shown for a single object which is a class itself (java.lang.Class), the hierarchy is presented for corresponding class, but not for class java.lang.Class.
  • New feature: action "Memory | Class Itself (java.lang.Class) by Name..." (Ctrl+Shift+C). The new action is similar to "Memory | Instances by Class...", but it opens the class object itself (java.lang.Class) for specified class instead of its instances. This new action can be used to explore class static fields, as well as class loader and super class hierarchy, especially for classes without instances.
  • Improvement: Garbage collection view: in addition to the collected object count and size columns, count and size of existing object columns are shown. Also, context actions such as "Memory | View Selected Objects... (F4)" are available, so you not only can get the numbers, but also browse the existing objects themselves. Note: statistics is shown for all objects in the snapshot; if you need allocation statistics for particular subset of objects, open corresponding objects view and use its "Allocations" section.
  • Improvement: objects view: UI cleanup: allocation views are not cluttered with GCed object statistics anymore, as they are aimed to analyse where particular existing objects were created. To analyse where excessive garbage was produced, use dedicated view Garbage collection instead.
  • Improvement: objects view: slave view "Callees List" for allocations has new columns "Objects (Own)" and "Size (Own)".
  • Improvement: objects view: slave views "Callees List", "Merged Callees" and "Back Traces" for allocations display information about objects which correspond to current selection in master view, but not objects of entire snapshot.
  • Improvement: Quick info shows retained object count as well as retained size

  • Improvement: Quick info shows text presentation for char[] and java.lang.String in scrollable text area. In particular, this allows to inspect long strings.
  • Improvement: Quick info allows to export entire string or primitive array to a file in following formats:

    • char[] and java.lang.String to a text file in UTF-8
    • byte[] to a binary file
    • primitive array values to a text file
  • Improvement: Quick info text presentation is shown initially positioned at beginning of the text. Also, long lines are wrapped.
  • Bug fixed: "Self referencing objects" inspection could give false alarm for some java.lang.Thread instances

CPU Profiling

  • Improvement: UI cleanup: slave views "Merged Callees" and "Back Traces" are shown for master views "Hot spots" and "Method lists" only, but not for "Call Tree" views, where they were useless. Should you need to quickly get information about all calls of the method selected in call tree, use actions "CPU | (View) Method Merged Callees in New Tab (Ctrl+M)", "CPU | (View) Method Back Traces in New Tab (Ctrl+Shift+M)" and "CPU | (View) Method by Name... (Ctrl+Shift+N)".

Telemetry

  • New feature: Threads view optionally shows all threads, only live threads or only finished threads.

  • Improvement: Threads view: Copy to clipboard action allows to copy strings containing character with code 0 (C-style string terminator). Previously, such strings were truncated.
  • Bug fixed: Threads view: scroller position might get lost on resize
  • Bug fixed: Threads view: "Stack Traces" tab might not update properly with "Show stack of selected thread only" selected

Probes

  • New feature: new built-in probe com.yourkit.probes.builtin.Processes monitors processes launched via Runtime.exec() and ProcessBuilder.start().
  • Improvement: mapping between monitored objects and corresponding event row indices no longer involves creation of temporary Integer objects. This reduces garbage collector load, as well as eliminates possible problem with internal map memory usage.

    Note on probes API: class com.yourkit.probes.ObjectIntWeakMap which implemented the old mapping approach has been deprecated. Instead, use com.yourkit.probes.ObjectRowIndexMap.

  • Improvement: improved performance of built-in probe com.yourkit.probes.builtin.Databases
  • Improvement: new startup option noprobe=<built-in probe short class name> allows not to register particular built-in probe on startup
  • Improvement: startup options 'probeclasspath' and 'probebootclasspath' allow specification of several elements, separated with system-specific path separator (';' on Windows, ':' on non Windows)
  • Improvement: it is now possible to use callback method parameter annotation @This declared as a reference type other than java.lang.Object in probes applied to constructors. However, note that the probe must not have onEnter callback; only onReturn, onUncaughtException or onUncaughtExceptionExt are allowed. If you need to apply onEnter to a constructor, declare parameter @This as java.lang.Object in all the probe callbacks.

IDE Integration

  • New feature: Eclipse: Maven run configuration type supported
  • New feature: NetBeans: Maven projects supported
  • New feature: IntelliJ IDEA 10 supported
  • Improvement: Eclipse: new simplified plugin UI
  • Improvement: Eclipse: the profiler plugin update site archive is bundled as <Profiler Installation Directory>/lib/eclipse-plugin/yourkit95_for_eclipse.zip. Use it instead of the online site http://www.yourkit.com/download/yourkit95_for_eclipse/ if installing the plugin with limited internet access.
  • Caveat: Eclipse: integration is supported for Eclipse 3.4 and newer only. Eclipse 3.3 is no longer supported.

User Interface

  • Improvement: to save vertical space for other components, the help bar height was reduced. Also, there is an option to hide the help bar ("Settings | Show Help Bar") and/or the status bar ("Settings | Show Status Bar")

  • Improvement: "Thread name" filter in "Threads" tab (and similar filters in other views) now optionally accepts full regular expression syntax
  • Improvement: before starting opening a memory snapshot, the profiler checks whether available disk space is enough to create temporary files needed to open the snapshot. If the available space is not enough, a warning is shown, as well as instructions on how to specify alternate temporary directory (e.g. on another disk).
  • Bug fixed: Mac OS X: hyperlinks in selected rows had text color almost indistinctive from the background

Miscellaneous

  • Improvement: Automatic deadlock detector is now able to find cycles of threads that are in deadlock waiting to acquire not only object monitors, but also ownable synchronizers (java.util.concurrent.locks.*)
  • Improvement: Command line tool to control profiling: added commands clear-cpu-data, clear-alloc-data, clear-monitor-data
  • Improvement: Solaris: profiler UI startup script yjp.sh automatically uses JDK 6 in Solaris standard location; this means that on most machines it will run out of the box
  • Improvement: Help is not only available online, but also as a ZIP archive for offline browsing (see Docs & Demos)
WATCH DEMOS

WHAT'S NEW
April 10, 2012
YourKit Java Profiler 11 released Read more »
April 19, 2012
YourKit Profiler 7.0 for .NET released Read more »
AWARDS
JDJ Editors' Choice Award Winner YourKit Java Profiler received the Java Developer's Journal Editors' Choice Award.
"I had to collect data about a memory leak that happen over several hours of time in the production server. Using other profilers this was not possible since they kept on crashing. Using YourKit this was amazingly easy. It just ran in the background and I gathered statistics at certain moments in time and then compared them against each-other. YourKit is a really nice profiler and I use it now."
Geert Bevin,
Lead developer of RIFE
web application framework