This page covers how to find what makes the Viewer slow, limit its memory use, track down data that is not shown, and run several native Viewers side by side.
Diagnose latency and performance
This section shows how to find the cause of slow frames and latency in the Viewer and during live streaming.
Show performance metrics
Start by opening the settings (Cmd/Ctrl + ,) and enabling "Show performance metrics".
This adds the following to the top bar of the Viewer:
- the RAM used by the Viewer
- the CPU time the Viewer spends per frame, in milliseconds
- the frame rate, in frames per second
- the end-to-end latency of any live data
- the round-trip time to any Rerun server you are browsing (missing from the screenshot below)
Hover any of them for details. The numbers only tell you that something is slow, so the rest of this section is about finding out why.
Built-in profiler
The native Viewer, the SDK, and the command-line tools are instrumented with puffin scopes.
In the web viewer, use the browser's own flame graph instead.
Save a trace to a file
To capture a profile, open the command palette (Cmd/Ctrl + K) and pick "Capture profile trace…".
This records five frames and asks you where to save them as a .puffin file.
Attach that file to a bug report, or open it later with puffin_viewer.
Profile a running Viewer
To view the live flame graph of a running Rerun Viewer, first install the puffin_viewer tool:
cargo install puffin_viewer --lockedNext, pick "Open profiler" in the Rerun command palette, or press Ctrl + Shift + P.
To profile the Viewer's own startup, start it with rerun --profile instead.
In the puffin viewer, each frame of the Rerun Viewer is one bar in the top graph.
Click a slow frame to freeze it, then read the flame graph below.
Scopes named [WAIT] mean that the thread is blocked waiting for another thread, so the real work is somewhere else.
Profile the SDK instead
If the latency breakdown points at the SDK rather than the Viewer, profile your own process.
For Python, set RERUN_PUFFIN=1 before importing rerun, and the SDK spawns a puffin_viewer for you.
For Rust, enable the server feature of re_tracing and call re_tracing::Profiler::default().start().
Memory
Slowness is often a memory problem in disguise.
The "Memory flamegraph", "Memory plot", and "Recordings" tabs of the developer panel (Ctrl + Shift + M) break down the Viewer's RAM use per recording and per subsystem.
Clicking the RAM number in the top bar takes you straight to the flame graph.
See limiting memory use for how to cap it.
Latency indicator
Latency on live data can come from many sources.
To figure out the bottleneck in your application, open the developer panel (via the command palette, or by hitting Ctrl + Shift + M) and pick the "Latency" tab.
You can also just click the latency indicator in the top bar, which is always shown when performance metrics are enabled, and otherwise appears on its own when the latency goes above one second.
The measurement starts at the log call in your SDK, and each step ends when:
| Step | Ends when |
|---|---|
batch creation | The SDK's background batcher closes the chunk that holds your data. |
gRPC sink | The chunk reaches the gRPC sink in the SDK. |
encode and transmit | The chunk is encoded as Arrow IPC and handed to the network. |
receive and decode | The Viewer has received the bytes and decoded them. |
ingest into viewer | The chunk is in the Viewer's chunk store, ready to be shown. |
The "Duration" column is the time spent since the previous step, so you can see which hop dominates, and "Since log call" is the running total. All values are a rolling average over the last second of incoming data.
Caveats
- Only live data has a latency.
- The measurement is clock-based.
If the SDK and the Viewer run on different machines, any clock skew between them is added to the total.
Steps that appear to happen before the
logcall are dropped, so a skewed clock also makes rows go missing from the breakdown. - The last step is bounded by the frame rate of the Viewer. The Viewer ingests data as part of its update loop, so a Viewer running at 10 FPS adds up to 100 ms of latency, no matter how fast your network is.
What to do about it
| Dominant step | What to try |
|---|---|
batch creation | Lower the micro-batching flush thresholds, in particular RERUN_FLUSH_TICK_SECS |
gRPC sink, encode and transmit | Increase the batch sizes for larger chunks and less overhead |
receive and decode | Send less data, for instance by compressing images |
ingest into viewer | The Viewer is the bottleneck: hide all views to check whether it is the rendering that is slowing down ingestion |
The Viewer can't keep up with my data
If you log at a high rate, the Viewer can fall further and further behind the live data.
The Viewer ingests new data as part of its frame loop, and spends at most about 10 ms per frame on it.
So when frames are slow, for example because a view is expensive to render, less data is ingested per second.
On the SDK side, the amount of data waiting to be sent is bounded (about 100 MiB by default).
When that buffer is full, log calls block until there is room again, so a slow Viewer can also slow down your program.
To find out which side is the bottleneck, use the latency indicator and the frame rate in the performance metrics.
Things to try on the data side:
- Log fewer, larger batches.
One
Points3Dwith 10 000 points is much cheaper than 10 000 entities with one point each. - Use
send_columnsto send many time points of the same data in one call. - Send compressed images with
EncodedImage, or video withVideoStream, instead of rawImagedata. - Log at a lower rate, for example only every n-th frame of a high-rate sensor.
- Tune the micro-batching settings. Larger batches mean less overhead per log call.
Things to try on the Viewer side:
- Hide or close expensive views, for example views with many entities, large point clouds, or many plotted series. If the Viewer keeps up with all views hidden, rendering is the bottleneck.
- Use a release build of the Viewer. Debug builds are much slower.
- Limit the memory use. When the Viewer is close to its memory limit, it spends time on dropping old data.
Why does the Viewer use CPU when idle?
The Viewer only redraws when something changes. Enable "Show performance metrics" (see above) and look at the frame rate while you don't touch the Viewer. If it keeps redrawing, the most common causes are:
- Data is streaming in. Every incoming message wakes the Viewer up, even if the new data is not visible.
- The time cursor is playing. Pause playback to stop redrawing.
To see what the Viewer is spending its time on, use the built-in profiler.
Limit the viewer's memory usage
This section shows how to cap the Viewer's memory use, and how to open recordings that are larger than RAM.
--memory-limit
The more data you log, the more RAM the Rerun Viewer uses. When it reaches its memory limit, it drops data to stay under the limit. The default limit is 75% of the total system RAM on native, and 2.5 GB in the web Viewer.
You can set the limit with the --memory-limit command-line argument, or the memory_limit argument of rr.spawn.
Both accept an absolute size such as 16GB, or a fraction of system RAM such as 50%.
Alternatively, you can adjust the limit in the Viewer's settings.
This setting is remembered between sessions, but --memory-limit overrides it, and rr.spawn always passes that flag (defaulting to 75%).
To find out what is using up the memory, see Diagnose latency and performance.
Why does memory keep growing?
If the Viewer uses more memory than you expect, or seems to ignore --memory-limit, check the following.
The new limit was never applied
rr.spawn() and rerun do not start a new Viewer if one is already listening on the same port (9876 by default).
They connect to the running Viewer instead, so the --memory-limit or memory_limit you pass this time is ignored.
Close the old Viewer first, or start a new one on another port:
rerun --memory-limit 4GB --port autoFrom Python, pass a different port to rr.spawn.
Static data is never dropped
Data logged with static=True is never garbage-collected.
Logging static data to the same entity again replaces the old value, but static data on many different entity paths (for example a new entity path for every frame) adds up without bound.
Log data that changes over time on a timeline instead.
See static data.
The latest value of each component is kept
For recordings that the Viewer cannot download again (for example data streamed live from the SDK), it always keeps the latest value of every component of every entity, so that the current state stays visible. If you log many entities, or entities with large components, this floor can be bigger than your memory limit.
The gRPC server has its own buffer
The SDK sends data to a gRPC server that runs inside the Viewer process.
That server keeps a copy of the data for Viewers that connect later.
Its size is capped separately with --server-memory-limit (default 1GiB), or the server_memory_limit argument of rr.spawn and rr.serve_grpc.
This buffer also counts toward --memory-limit when you use the default limit.
With a lower --memory-limit, it counts only when the process uses more memory than the default limit.
Can I open recordings that are larger than RAM?
Yes, as long as the Viewer can read the recording on demand. The Viewer then keeps only part of the recording in memory, downloads the chunks it needs for the current time, and drops chunks it no longer needs. This works when you:
- Open a local
.rrdfile in the native or web Viewer. Local.rrdfiles are loaded through the Viewer catalog by default (Settings → Viewer catalog → Load files via Viewer catalog). - Open a recording from a Rerun server, for example one started with
rerun server, or from Rerun DB.
It does not work for data that streams in live from the SDK, or for .rrd files when you have turned off Load files via Viewer catalog.
The Viewer loads that data fully into memory, and drops the oldest data when it reaches its memory limit.
Make sure the file has a footer
On-demand loading needs the footer at the end of the .rrd file.
The SDK and the rerun rrd tools write the footer when they close the file.
A file can be missing its footer if the process that wrote it was killed, or if it was written by an old version of Rerun.
Without a footer, the whole file is read into memory.
To check a file, and to rewrite it with a footer:
rerun rrd verify my_recording.rrd
rerun rrd optimize my_recording.rrd -o my_recording_optimized.rrdrerun rrd optimize also compacts the chunks, which makes on-demand loading faster.
See Optimize chunk count.
Serve many large files
To browse a directory of large recordings, serve it with a local Rerun server and open it from the Viewer:
rerun server --temporary -d my_dataset=/path/to/recordings
rerun rerun+http://localhost:51234The web Viewer
The web Viewer runs as 32-bit WebAssembly, so it can address at most 4 GiB of memory, and its default memory limit is 2.5 GB.
With Load files via Viewer catalog turned on (the default), it can still open .rrd files that are larger than that.
Some of my data is not shown
If you logged something but can't see it in the Viewer, go through the list below. First, check that the data arrived at all: look for the entity in the streams panel at the bottom.
The time cursor is on another timeline
Data is only shown on the timelines it was logged on.
If you log with rr.set_time("frame", sequence=…) but the Viewer shows another custom timeline, for example sensor_time, the data appears to be missing.
By default, the SDK also logs all data on the automatic log_time timeline, so log_time shows it unless you turned that timeline off.
Pick the right timeline in the timeline panel.
Static data is shown on every timeline.
See timelines.
The time cursor is before the first data point
The Viewer shows the latest value at or before the time cursor. If the cursor is before the first time an entity was logged, the entity has no value yet and is not shown. Move the time cursor forward, or press play.
The entity is not part of any view
Views only show the entities that their entity path filter includes. If you changed the query, or set up the layout with a blueprint, new entities may not match it. Select the view and check its entity path filter in the selection panel, or right-click the entity in the streams panel and pick Add to new view.
When the Viewer creates views automatically, it creates at most 8 views of each kind (for example 8 time series views). If your data needs more, add the views yourself in the UI or with a blueprint.
The entity is hidden
An entity can be hidden in a view with the eye icon in the blueprint panel. Check that it is visible.
The view can't place it in space
In 2D and 3D views, an entity whose transform frame isn't connected to the view's origin can't be drawn. The view shows an error for it in the selection panel. See Debugging transform trees.
Points that are too small to see, or 2D elements hidden behind others, are covered in Rendering issues.
Labels are not shown
For points, boxes, arrows, line strips, and similar shapes, labels are hidden by default when an entity has 30 or more instances, to avoid clutter.
A single label for the whole entity is always shown.
To always show labels, set show_labels=True:
rr.log("points", rr.Points3D(positions, labels=names, show_labels=True))Some plot series are missing
When you plot a component that isn't logged as Scalars (see Plot any scalar), a time series view shows at most 100 series per entity.
Log the values as Scalars to plot more.
Old data disappeared
When the Viewer reaches its memory limit, it drops data to stay under it, oldest first for live data. See Limit the Viewer's memory usage.
The data is in another recording
Data with a different application ID or recording ID goes to a separate recording. Check the recording panel on the left and select the right recording. If several processes log to the same recording, they need the same application ID and recording ID, see Share recordings across multiple processes.
Old data stays visible
Views use latest-at semantics: a value remains visible until another value is logged for that entity.
Log Clear to remove it at a given time.
Static data is not on a timeline and is unaffected by visible time ranges.
Data is outside the visible time range
A view with a visible time range does not show data outside that range. Check the view or entity settings in the selection panel.
Use multiple native viewers
You can run multiple Native Viewer windows simultaneously, each displaying different data or views of the same data.
How it works
Every Native Viewer binds to a gRPC port on startup. By default, this is port 9876. When you run rerun, it checks if a viewer is already listening on that port:
- If yes: it connects to the existing viewer (or sends data to it)
- If no: it starts a new viewer on that port
To open multiple viewer windows, use different ports with the --port flag.
Examples
# Start a viewer on the default port (9876)
$ rerun &
# This does nothing — a viewer is already running on :9876
$ rerun &
# Start a second viewer on port 6789
$ rerun --port 6789 &
# Log an image to the first viewer (port 9876)
$ rerun image.jpg
# Log an image to the second viewer (port 6789)
$ rerun --port 6789 image.jpgFrom the SDK
When using connect_grpc() from the SDK, specify the port to target a specific viewer:
# Connect to the Viewer on the default port (9876):
rr.connect_grpc()
# Or connect to the Viewer on port 6789:
rr.connect_grpc("rerun+http://127.0.0.1:6789/proxy")Tips
- Use
spawn()to automatically start a new viewer if needed — it will reuse an existing viewer on the default port if one is running - Each viewer maintains its own Chunk Store, so data sent to different viewers is independent
- The Web Viewer connects to the gRPC server over gRPC-Web (HTTP), not over a raw gRPC connection