MountainGraph help
A file is read here, in the browser: nothing is sent anywhere. Files are recognized from their
content, not their name: JFR recordings, Flamepacks (written by jfr-web, jheap or other tools), collapsed stacks,
and heap dumps
(.hprof, gzipped or not).
Reading the landscape
The weight of what is measured is drawn as relief. For a profile it is the time spent in methods (or the bytes allocated, for the allocations of a recording), for a heap dump the memory held by objects. The same picture reads the same in both:
- A peak is one thing that weighs a lot: a method, a class, a package, or a chain of objects holding memory. The higher and wider it is, the more it weighs.
- The slopes around a peak are what leads to it. Each step out from the peak is one more frame: for samples, the method that called it; for a heap, the object that holds it. Going out is going toward the start of execution, or toward the root of the heap.
- A sector is one frame at one depth. Its angle is its share of the frame it leads to, so the sectors of a ring add up to the ring inside it.
- The plain is what no peak holds. Where a sector has nothing further out, the plain begins: execution entered there, or the object was the root.
The names over the peaks are shortened to their last two parts (cfg.ConfigImpl). The full name is
in the line under the view when a frame is hovered, and in the panel when a peak is clicked.
Hovering a frame lights every frame of the same name, in all the mountains: this is how to see where a class or a method shows up elsewhere. The line at the bottom left tells what is hovered: its size, its share of its peak, and the path that leads from it to the peak. For a heap, the path is the object first and the objects holding it after it, out to the peak: the same as the start of Held by.
The thin lines inside a mountain are the limits of the zones that can be hovered: each frame is one zone. A frame holding less than half a percent of its peak has none, or the slopes would be all lines. The first frames out from a peak are drawn as a disc around its summit, split in sectors, each as wide as the frame it stands for: this is where the biggest holders of a peak are, however far their ridges would reach. The heavier lines between mountains are their divides.
Moving around
2D
The wheel, or a pinch of two fingers, zooms around the mouse or the fingers, a drag moves the map, a double click shows the whole terrain again. Where the map was is kept when a setting changes. A click on a mountain opens its panel; a click on the plain closes it.
In both views, hovering a frame shows its path from the peak in a line over the view.
3D
A drag turns the terrain around the point looked at, the ground at the middle of the window, wherever the view was moved before; a drag with Shift held, or with the right button (or two fingers), slides it instead of turning it. The wheel or a pinch moves the view toward that point or away from it, and on over the ground once near it, a double click shows the whole terrain again. The arrows fly over the land, Q and E (A and E on AZERTY) lower and raise the view, Shift goes faster. F looks around as in a shooter: the page goes full screen, with no bars nor popups, the mouse is locked and turns the view where it stands, the keys then move forward, back and sideways with W A S D (the keys in their places: Z Q S D on an AZERTY keyboard) or the arrows (which then take over S, a picture's key; Q and E still lower and raise it); F or Esc gives the mouse back. A cross in the middle of the view is what a click reaches: a peak, or a frame of the flame graph, which is purple while the cross is on it. The camera is kept like the 2D map's. The relief, the islands, the blocks and the flame graph are at the end of the Landscape settings, shown in 3D only.
Peaks
What makes a peak, and how many are drawn. Settings that do not apply to the choice made are not shown.
At most
The most peaks drawn, the heaviest first.
Until
No more peaks once the ones taken hold this share of the whole (100 % means the count above decides). The rest is the plain.
Heap settings
Ranked by
What a peak of a heap is. The two choices tell two different things, and they are not shown alike.
- What they hold (the default)
- The question is which objects keep the memory alive. The heap is read as a tree: each object is held by the first object found that points to it, from a root of the heap (a thread, a static field…). A peak is a chain of holders, reported at the deepest object that still holds most of what is above it, so a cache and the map inside it make one peak, not two. Its height is what it holds, its own objects included. The mountain is what the peak holds: the slopes go down to what it holds. The panel has two tabs, Holds and Held by, and an object clicked in either can be walked to.
- Own size
- The question is which classes take the most room themselves. A peak is a class or package
(One per), its height the shallow size of its instances: only their own fields,
not what they point to. A
byte[]is a peak because there are many of them, not because it holds anything. The mountain is what holds those objects: the slopes go out through the objects that reference them, toward the roots. The panel has one list, held by, which is those slopes as a tree.
So the same String may be a small peak of its own in Own size and only a slope of the
object that owns it in What they hold. When a peak looks wrong, check which of the two it is.
Thin wrappers
What they hold only. A thin wrapper is an object that passes on almost everything it holds to several others and owns under 1 % of it: a handler or a manager the walk entered the graph by. It does not consume memory, it is where the walk got in. Skipped (default), what it holds belongs to the objects inside it, which are the peaks. As peaks keeps it as one peak, a big and mostly empty mountain.
One per
Own size only. What a peak gathers: all the instances of a class, or all the classes of a package. For samples the same setting offers the method too: see Samples settings.
Context
Own size only. How many frames make a peak. The class alone gathers all the instances of a class
wherever they are. 2 frames and more gather the instances of a class held by one class (or by
one chain of two, three…): HashMap$Node ← ConcurrentHashMap and HashMap$Node ← Cache are
two peaks, so that a map and what it holds are seen as one thing. The name reads "the object ← its holder".
More frames make more, smaller peaks.
Samples settings
For a recording of samples (JFR, Flamepack, collapsed stacks). A file may hold several kinds of samples (CPU time, wall clock, allocation): the choice in the header says which counts. What is left out of the samples (the waits, the hidden frames, the native samples) is in the Filters section of the settings, folded at first. Every section of the settings folds, and stays open or folded as it was left.
What the samples count
The weight of a sample: time (the wall clock: Java and native samples, waiting included) or bytes allocated. A JFR recording holds both, and the choice in the header switches between Wall clock and Allocations; a profile that knows only one has no choice. The two are not mixed, as they weigh different things. The allocations read differently.
Allocations
The samples are the allocations the recording sampled (jdk.ObjectAllocationSample), each
weighing the bytes it stands for: the picture is the memory allocated over the recording, not what is alive
at some moment (for that, a heap dump). Sizes are in bytes, not time, and there is no time spent.
- The top of each stack is the class allocated (
byte[],HashMap$Node…), with the method that allocated it under it. So a peak is a class, or the method when the class is hidden; the slopes are the call paths that allocated it, out to the thread that started them. - The class is a frame like the methods: Hide frames applies to it by its name. With the
JDK hidden (the default), a
java.lang.Stringorjava.util.ArrayListallocated is not a peak, its bytes go to the application method that allocated it; empty the field to see the classes.byte[]and the other arrays are not underjava.*, so they remain. - Leave out waits looks at the top frame, which is a class here, so it leaves nothing out. Java samples only does not apply either: an allocation has no native or Java kind.
- The timeline shows bytes per interval, so a burst of allocation can be dragged out and read alone.
Leave out waits
A regular expression for top frames: the samples whose top frame matches are not counted. A thread waiting in a socket read or a poll weighs time waited, not work, and would be the highest peak of a wall-clock profile. Empty for none.
Hide frames
A regular expression for frames to take out of the stacks: their time goes to their callers. By default the JDK
is hidden (java.*, jdk.*, sun.*…), so that the time goes to the
application code that called it: String.equals is seen as the code that compares.
Java samples only
Leaves out the native samples: threads blocked in native code, waiting.
One per
What a peak gathers: a method, a class (all its methods), or a package. CPU time is spread over many methods: gathered, fewer peaks hold more of it. The slopes are the callers.
Landscape
Mountains
How the slopes around a peak are raised. All three come from the same tree.
- Massif
- Each sector is raised to its weight, in rings: the peak at the centre and one ring for each step out. A frame never weighs more than the one it leads to, so the slopes only go down. A single path keeps its height (a mesa); a fork steps it down. The first rings are narrow, as a path may be many frames long.
- Ridges
- Each frame is a ridge from the one before it out to the middle of its sector, as wide and as high as its weight, lower the further out. One way in gives a single spur, many a star. The summit is a dome whose sectors are the first frames (zones).
- Ranges
- Ridges, with a frame that several mountains share drawn once, between them: a saddle, as high
as the most one of them goes through it, marked
)(and named. Its own callers follow it. A frame most mountains share (a thread's main loop) is not merged: it would pull everything together. Where two mountains meet and are not joined, a divide.
Mountains related through a frame they share, however far apart, are linked by a dashed trail, named after the frame, wider the more of the smaller mountain went through it. The fine tuning sets how many and how strong.
Colour
Height tints by weight only. Package gives each package a hue, sub-packages near their parent, the height still setting how light it is; a legend names the main ones. In 3D, the highest rock and snow are painted on top and are not a package. Package colours are for peaks that are a single frame: a heap by Own size with the class alone, or a profile.
2D, 3D or Flame
The same terrain as a topographic map (contours each half the height of the one above) or in three dimensions. Flame shows the whole profile as a flame graph instead, peaks or not: a frame as wide as its weight, its callees on top of it (for a heap, what it holds). A click zooms on a frame, a click on a faded one under it zooms back out; the search colours the frames it finds and says their share. The filters apply: the interval of the timeline, the operation, the frames hidden.
The panel
A click on a mountain opens its panel at the right of the view; drag its left edge to widen it, and close it with the cross or a click on the plain.
Callers and callees (samples)
Callers: the tree of what called the peak, the heaviest first, which are the slopes. Callees: what the peak itself called, and the methods where time was spent at the top.
Holds (heap, ranked by what they hold)
What the object holds, as a tree, the heaviest first. A name clicked shows that object instead, with the same two tabs; ← peak goes back.
Held by (heap)
Who holds the object: the object first, then the one that holds it, out to the root. Each level's size is what that holder holds, so it only grows outward; the shares are those of the outermost holder.
Own size peaks show this list alone: they hold nothing of their own to list, the slopes are what holds them.
3D view
The settings of the 3D view are at the end of the Landscape section of the settings, shown in 3D only.
Relief
The height of the highest peak, as a share of the terrain's size. Heights are the weight to a power (the height curve), so that small peaks show.
Islands
The plain becomes a sea, the mountains islands: sand along the shore, grass, then rock where it is steep.
Sea level
How high the water is: a higher sea covers more of the land, a lower one uncovers more. The land keeps its shape under the sea.
Blocks
The land is built of blocks. Block size is the size of one, in cells of the terrain: smaller blocks follow the mountains more closely and take longer to build.
Flame graph
The flame graph of the whole profile stands behind the terrain, as wide as it, its root on the ground. A frame hovered on the terrain colours the frames of its name in the flame graph, wherever they were called; a frame hovered in the flame graph lights its name on the terrain. A click on a frame zooms on it: the panel then shows only that frame and its callees, lower, with its caller under it, faded, which a click zooms back out to. Very deep stacks are cut at the top.
Signs
Each peak carries a sign: its name, with its weight under it, over the summit, as a road sign with no pole. It always faces the camera, grows a little as the camera comes near and shrinks as it goes away, and gives way to a higher peak's where the two would overlap. Signs sets its colour (white, yellow, blue, red or green) and Sign size how large it is. Both are kept with the camera in a saved file's settings.
Timeline
For a recording with time (not collapsed stacks): the strip under the header shows the weight of the samples over the recording. Drag to choose an interval; the landscape is built from the samples inside it. Drag an edge of the interval to adjust it, drag inside to slide it along the recording (its width is kept), click outside to clear it. The landscape follows a drag every 150 ms and again when it is let go.
When the samples are in operations (flak requests, jfrweb.ops), the bars are stacked by
operation in the colours of jfr-web, a legend names them, and a click on one shows that operation alone.
Keep the peaks of the whole recording
The peaks stay where they are, with the scale of the whole recording, and each mountain grows or shrinks in place as the interval moves, instead of the peaks being chosen again in each interval. This is how to see something move.
Fine tuning
The values the terrain is raised with, as sliders (− and + move one step), remembered. Only those that change what is shown are listed.
- Foot height
- Ridges and ranges: a low dome under each mountain, as high as this share of its peak, so that its bulk shows its weight.
- Ridge width
- The peak's ridge, as a share of the mountain's radius. It is also the radius of the summit's disc of zones.
- Saddle reach
- Ranges: how far apart two mountains may stand, in the sum of their radii, for a frame they share to make a saddle.
- Trail threshold
- The least share of the smaller mountain's weight through a shared frame, for a trail.
- Trails per mountain
- The most trails from a mountain, the strongest first.
- 3D height curve
- Heights as the weight to this power: 0.5 lets small peaks show, 1 makes them as high as their weight.
- Island bumps
- How rough the islands are.
- Island rock slope
- How steep a slope turns to rock: lower, more rock.
- Invert the mouse
- Looking around in 3D (F): moving the mouse up looks down, as in a flight simulator.
Anonymizing
Replaces names as a file is read, to share a picture or a profile without what its names say. A change applies when the file is read again: Apply.
Two transforms, each ticked on its own, with its settings under it. The settings of one that is not ticked are kept, and ignored.
- Replace packages by aliases
- Each package becomes a made-up one, the same everywhere (
com.acme.billing.Invoicebecomescom.bart.lisa.Invoice). Depth is how many segments after the domain get aliases: 2 iscom.x.y, what is under keeps its name. Packages kept keep their names, with what is under them (java,org.apache). - Replace texts
- One per line,
text => replacement, wherever the text is found in a name or a thread's name, whatever its case. The replacement follows the case found:foo => barmakesfoobar,FooBar,FOOBARandfoostuffbarstuff.
Saving
The file's menu, under its name in the header, saves what is shown as a Flamepack (.fpk), which
jfr-web reads too.
- All data, or a loss
- All data writes the whole profile. A level of loss writes a much smaller
-reduced.fpk, for a gallery or a report: for samples it drops the stacks of the methods that hardly run, for a heap what the page does not draw. The size is said before the file is saved. - The file's name
- Proposed from the file opened, and changed by typing. Its ending follows the loss and the gzip chosen.
- Gzipped
- Compresses the file, a few times smaller; the page opens it as it is. On unless unchecked.
- Only what is shown
- With a loss, samples only. Leaves out what the settings leave out: the waits, the hidden frames, the native samples when only Java is shown, and what is outside the interval or the operation in focus. The file draws as the view drew it.
- With the settings of the view
- Keeps how the page is set: the view, the shape of the land, the peaks counted, the camera. Whoever opens the file sees what was shown. The anonymizing settings are never kept. With only what is shown, the waits, hidden frames and Java-only settings are not kept either: the profile has them applied.
- With the tour
- Shown when the file has a tour, and on unless unchecked. Whoever opens the file is shown its views, with their captions.
Tour
A tour walks someone through a profile: views of it, each with a caption, shown one after the other. It is made in the Tour section of the settings, and saved with the file.
T, or Add this view, adds the view as the page shows it: 2D, 3D or Flame, the settings of the
view, the camera, the peak chosen, the interval and the operation in focus on the timeline, the frame under
the mouse with the box telling its path, and the Peaks pane open or folded. Each view has a caption, typed
beside its number; a web address in it (https://…) is a link on the bar, which opens in another tab
and pauses the tour. The arrows beside it move it up or down, take the view shown in its place, or remove it.
Its number shows it.
P, or Play, plays the tour. A bar at the foot of the window gives the caption and steps through the views: ← and → go back and on, Space pauses, Esc ends the tour. A line along the foot of the bar runs down until the next view. Where two views differ only by the 3D camera and the frame hovered, the camera flies from one to the other; otherwise the view is drawn again. A click on the view pauses the tour.
Each view sets how long a view stays once the camera is there, 5 seconds at first, and Flight how long the camera takes to fly to the next, 2 seconds. They are kept with the tour.
A file saved with its tour plays it when opened. The land is laid out to the window's shape: in a window of another shape, the views are the same, the land a little different.
Pictures
With the view shown: S saves it as a PNG, C copies it to the clipboard. The picture has the map or the 3D canvas, with the names over the peaks, and not the panels floating over it. With Shift (Shift+S, Shift+C) the picture has the panels too, the line of the frame hovered, the panel of the peak and the legend of the colours, those shown: they are drawn again, so close to the page's but not the same.
The page's Help opens with ? or F1; a ? beside a setting opens it at that setting.