Skip to content
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

Memory pruning #299

Merged
merged 36 commits into from
Nov 21, 2022
Merged

Memory pruning #299

merged 36 commits into from
Nov 21, 2022

Conversation

emilk
Copy link
Member

@emilk emilk commented Nov 15, 2022

This is the first-effort to implement memory pruning, i.e. to keep the memory use of Rerun Viewer below some certain threshold.

Example: RERUN_MEMORY_LIMIT=2GB cargo r -- ../objectron.rrd. The pruning limit is not yet set-able on web (and is always off there).

This PR also introduces a memory panel where you can see the current memory use:

Screen Shot 2022-11-20 at 22 11 41

This PR does the pruning by removing the oldest half of each timeline. Another strategy would be to use the common time now stored in MsgId, but that relies on MsgId remaining a time-based ID, which may be something we walk back on once we switch to Arrow.

There is still quite a bit of memory not beeing freed. I will investigate where and why after this PR is merged.

crates/re_viewer/src/app.rs Outdated Show resolved Hide resolved
@emilk emilk force-pushed the emilk/mem-pruning branch from fca6a5b to 3808119 Compare November 20, 2022 16:17
@emilk emilk force-pushed the emilk/mem-pruning branch from 48dae5f to cd41997 Compare November 20, 2022 18:03
@emilk emilk marked this pull request as ready for review November 20, 2022 19:04
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

A bunch of comments, though I don't think this is worth doing another round of review, have my 🟢.

crates/re_data_store/src/log_db.rs Show resolved Hide resolved
crates/re_renderer/src/workspace_shaders.rs Show resolved Hide resolved
crates/re_string_interner/src/lib.rs Outdated Show resolved Hide resolved
crates/re_string_interner/src/lib.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/mem_tracker.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/mem_tracker.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/mem_tracker.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/mem_tracker.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/memory_panel.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/memory_panel.rs Show resolved Hide resolved
@emilk emilk merged commit ef6db3f into main Nov 21, 2022
@emilk emilk deleted the emilk/mem-pruning branch November 21, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants