Skip to content

fix(ext/node): fix vm memory usage and context initialization - #23976

Merged
littledivy merged 21 commits into
denoland:mainfrom
littledivy:vm_snapshot_context
Jun 12, 2024
Merged

littledivy merged 21 commits into
denoland:mainfrom
littledivy:vm_snapshot_context

Conversation

@littledivy

@littledivy littledivy commented May 24, 2024 •

Copy link
Copy Markdown
Member

Fixes #22441
Fixes #23913
Fixes #23852
Fixes #23917

@littledivy
littledivy force-pushed the vm_snapshot_context branch from e6b9229 to 22690cd Compare May 24, 2024 14:20
@littledivy
littledivy force-pushed the vm_snapshot_context branch from 22690cd to 848dabd Compare May 24, 2024 14:31
@littledivy
littledivy marked this pull request as draft May 24, 2024 14:49
littledivy added a commit to denoland/deno_core that referenced this pull request Jun 7, 2024
Remove usage of rusty_v8 annex slots for storing `ContextState` and
`ModuleMap` and instead store them directly in a dedicated embedder
field.

Needed for denoland/deno#23976
@littledivy
littledivy marked this pull request as ready for review June 12, 2024 03:42
@littledivy

This comment was marked as resolved.

@littledivy littledivy changed the title perf(node): reuse vm snapshot context fix(ext/node): fix vm memory usage and context initialization Jun 12, 2024
@littledivy
littledivy requested a review from bartlomieju June 12, 2024 11:23
Comment on lines +691 to +700
// Uncomment for remote debugging
// {
// name: "Setup tmate session",
// if: [
// "(matrix.job == 'test' || matrix.job == 'bench') &&",
// "matrix.profile == 'release' && (matrix.use_sysroot ||",
// "github.repository == 'denoland/deno')",
// ].join("\n"),
// uses: "mxschmitt/action-tmate@v3",
// },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this left on purpose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, ive used it quite a few times for segfaults in CIs

Comment thread ext/node/ops/vm.rs Resolved
Comment thread ext/node/lib.rs
let mut external_references = Vec::with_capacity(7);
let mut external_references = Vec::with_capacity(14);

vm::GETTER_MAP_FN.with(|getter| {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should try to remove this thread local hack - maybe the problem is now gone

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But not in this PR

Comment thread ext/node/ops/vm_internal.rs Resolved
Comment thread ext/node/ops/vm_internal.rs Resolved
@littledivy
littledivy requested a review from bartlomieju June 12, 2024 14:01

@bartlomieju bartlomieju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@littledivy
littledivy merged commit 1d290cc into denoland:main Jun 12, 2024
@littledivy
littledivy deleted the vm_snapshot_context branch June 12, 2024 17:03
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.

Bug: Panic in Jest Memory leak in node:vm Bug: Node vm doesn't have Node's global global Deno panics import node:process from within a vm.Script

2 participants