-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static=True image logging still stores all the data #7404
Comments
There are two issues at play:
The fix for 1) is to properly account for static overwrites on the write path: patch all dangling references, decreases stats, fire events. The fix for 2) is to set up a store subscriber so that the image cache drops overwritten data immediately. |
Moves `Caches` from `AppState` to the `StoreHub`, and make them per-recording instead of viewer-wide in the process. This is: * a pre-requisite to fix the repeated static logging issues (#7404) * a necessary step towards proper secondary caching * a fix for a very old issue: cache memory is not reclaimed when closing a recording I'm not a fan of the implementation: it's brittle, confusing, and I don't like it. Still, it's a net improvement over the status quo, and fixes a very annoying "leak" for end users. Before: https://github.com/user-attachments/assets/a54c1923-a939-4700-a485-eeb2a2dd4966 After: https://github.com/user-attachments/assets/dd5adb65-d328-474c-bc31-e65a59332f03 --- * Part of #7404
Unreachable static chunks are dead weight: there exists no query that can access their data (at least when using Rerun as a Visualizer). By automatically removing dangling chunks, we make it possible for user to use the Rerun Viewer as a soft-realtime telemetry system (provided we properly invalidate our caches too, which is the subject of an upcoming PR). This raises the question of what should happen when using Rerun as a database: should this data be kept and made accessible? If so, this behavior should probably be made configurable (e.g. when instantiating a ChunkStore in the SDK). * Part of #7404 --- Test: ```python from pathlib import Path import rerun as rr image_file_path = Path(__file__).parent / "ferris.png" rr.init("rerun_example_encoded_image", spawn=True) for _ in range(0, 10): rr.log("image", rr.EncodedImage(path=image_file_path), static=True) ``` Command: ``` RERUN_FLUSH_NUM_ROWS=0 python test.py ``` Before: ![image](https://github.com/user-attachments/assets/a9823055-5247-4d63-9295-fc310aa4923f) After: ![image](https://github.com/user-attachments/assets/c095fda2-02ac-4456-bf3f-e251b24dc75d)
Thank you for the fix! Can confirm it works now 🙏 |
Describe the bug
I am using
rr.log(..., static=True)
with images and the expectation that the memory consumption should stay stable over time. I only want to see the latest logged image.I also have the expectation that when opening the (web) viewer, I do not have to watch through all of the history to the current frame.
Both is not met for some reason.
To Reproduce
Script to repro (uses webcam
0
on macOS, but should work with any computer with we webcam. Maybe try/dev/video0
for ubuntu).scratch_5.py.zip
Expected behavior
Sidebar data source size stays stable and whatever a single JPEG image takes, let's say 20mbyte to be generous.
Unfortunately, it doesn't
Desktop (please complete the following information):
Rerun version
Tested on 18.0 and 18.2 with same unexpected outcomes.
Additional context
Discord post: https://discord.com/channels/1062300748202921994/1075873257124810852/1283124563902992537
The text was updated successfully, but these errors were encountered: