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

V8 will not garbage collection? #197

Closed
pigLoveRabbit520 opened this issue Oct 18, 2021 · 1 comment
Closed

V8 will not garbage collection? #197

pigLoveRabbit520 opened this issue Oct 18, 2021 · 1 comment

Comments

@pigLoveRabbit520
Copy link
Contributor

pigLoveRabbit520 commented Oct 18, 2021

I will load a helper script in advance:

ctx, _ = v8go.NewContext(iso)
_, err = ctx.RunScript(content, "tool.js")

tool.js just contains a helper class like this:

class Helper {
  add(a, b) { return a +b; }
}

And I will invoke Helper.add function many times:

a, b := 4, 5
val, err := ctx.RunScript("(function(){ const h = new  Helper();  return h.add(%d, %d)) })();", "")

I found UsedHeapSize of iso continuously increased and never went down, V8 will not gc?

@dylanahsmith
Copy link
Collaborator

Duplicate of #105

@dylanahsmith dylanahsmith marked this as a duplicate of #105 Oct 18, 2021
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

No branches or pull requests

2 participants