-
Notifications
You must be signed in to change notification settings - Fork 168
Limit Rerun viewer memory to 4GB default #949
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,14 +64,15 @@ | |||||
| _rerun_init_lock = threading.Lock() | ||||||
|
|
||||||
|
|
||||||
| def init_rerun_server(viewer_mode: str = "rerun-web") -> str: | ||||||
| def init_rerun_server(viewer_mode: str = "rerun-web", memory_limit: str = "4GB") -> str: | ||||||
| """Initialize Rerun server in the main process. | ||||||
|
|
||||||
| Starts the gRPC server and optionally the web/native viewer. | ||||||
| Should only be called once from the main process. | ||||||
|
|
||||||
| Args: | ||||||
| viewer_mode: One of "rerun-web", "rerun-native", or "rerun-grpc-only" | ||||||
| memory_limit: Maximum memory for Rerun viewer (e.g., "16GB", "25%"). Default 16GB. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: docstring says "Default 16GB" but the actual default is "4GB"
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Smh true |
||||||
|
|
||||||
| Returns: | ||||||
| Server address for workers to connect to. | ||||||
|
|
@@ -89,8 +90,8 @@ def init_rerun_server(viewer_mode: str = "rerun-web") -> str: | |||||
|
|
||||||
| if viewer_mode == "rerun-native": | ||||||
| # Spawn native viewer (requires display) | ||||||
| rr.spawn(port=RERUN_GRPC_PORT, connect=True) | ||||||
| logger.info("Rerun: spawned native viewer", port=RERUN_GRPC_PORT) | ||||||
| rr.spawn(port=RERUN_GRPC_PORT, connect=True, memory_limit=memory_limit) | ||||||
| logger.info("Rerun: spawned native viewer", port=RERUN_GRPC_PORT, memory_limit=memory_limit) | ||||||
| elif viewer_mode == "rerun-web": | ||||||
| # Start gRPC + web viewer (headless friendly) | ||||||
| server_uri = rr.serve_grpc(grpc_port=RERUN_GRPC_PORT) | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt we go off of system settiings similar to how we set num_workers based on CPU cores? Versus 4gb pretty arbitrary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and it should probably be a percentage. It's
75%by default if not configured. Maybe 25-50%?