-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement recording/last-modified-at aware garbage collection (#4183)
**Commit by commit, there's renaming involved!** GC will now focus on the oldest-modified recording first. Tried a lot of fancy things, but a lot of stress testing has shown that nothing worked as well as doing this the dumb way. Speaking of stress testing, the scripts I've used are now committed in the repository. Make sure to try them out when modifying the GC code :grimacing:. In general, the GC supports stress much better than I thought/hoped: - `many_medium_sized_single_row_recordings.py`, `many_medium_sized_many_rows_recordings.py` & `many_large_many_rows_recordings.py` all behave pretty nicely, something like this: https://github.com/rerun-io/rerun/assets/2910679/26f67d69-de0e-4002-8936-2ac32c451cc3 - `many_large_single_row_recordings.py` on the other hand is _still_ a disaster (watch til the end, this slowly devolves into a blackhole): https://github.com/rerun-io/rerun/assets/2910679/673ee10c-2eca-4e3e-b285-77714e5c3d61 This is not a new problem (not to me at least 😬), large recordings with very few rows have always been a nightmare on the GC (not specifically the DataStore GC, the GC as a whole through the entire app). I've never had time to investigate why, but now we have an issue for it at least: - #4185 --- - Fixes #1904
- Loading branch information
Showing
9 changed files
with
234 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Stress test for cross-recording garbage collection. | ||
Logs many large recordings that contain a lot of large rows. | ||
Usage: | ||
- Start a Rerun Viewer in release mode with 2GiB of memory limit: | ||
`cargo r -p rerun-cli --release --no-default-features --features native_viewer -- --memory-limit 2GiB` | ||
- Open the memory panel to see what's going on. | ||
- Run this script. | ||
- You should see recordings coming in and going out in a ringbuffer-like rolling fashion. | ||
""" | ||
from __future__ import annotations | ||
|
||
import rerun as rr | ||
from numpy.random import default_rng | ||
|
||
rng = default_rng(12345) | ||
|
||
for i in range(0, 20000000): | ||
rr.init("rerun_example_recording_gc", recording_id=f"image-rec-{i}", spawn=True) | ||
for j in range(0, 10000): | ||
positions = rng.uniform(-5, 5, size=[10000000, 3]) | ||
colors = rng.uniform(0, 255, size=[10000000, 3]) | ||
radii = rng.uniform(0, 1, size=[10000000]) | ||
rr.log("points", rr.Points3D(positions, colors=colors, radii=radii)) |
Oops, something went wrong.