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

perf: use available system memory for v8 isolate memory limit #26868

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Nov 14, 2024

Instead of using the default 1.4Gb limit (which was meant for browser tabs) configure V8 to
set the heap limit to the amount of memory available in the system.

Closes #23424
Closes #26435
Closes #21226

@bartlomieju
Copy link
Member Author

We might also want to add an API like https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory to respect cgroups on Linux, this is useful when running in a container.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

@bartlomieju bartlomieju merged commit c9baf38 into denoland:main Nov 15, 2024
17 checks passed
/// Instead probe for the total memory on the system and use it instead
/// as a default.
pub fn create_isolate_create_params() -> Option<v8::CreateParams> {
let maybe_mem_info = deno_runtime::sys_info::mem_info();
Copy link
Member

Choose a reason for hiding this comment

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

image

This seems very slow and negatively affects startup time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants