Avoiding memory bloat with non-external runtimes
還沒有人認領這個 Issue。
評估
研究方向
Start with the ExecJS.compile and compiled-context call API described in the issue, then trace how non-external runtimes manage their contexts. Define the release lifecycle and behavior after release, including whether memory is reclaimed by MiniRacer. The issue does not name implementation files or tests, so those must be located before work can be scoped.
由索引模型根據 Issue 內容生成。
描述
I have observed that when using miniracer with our precompile assets process memory can run away big time.
This is cause sprockets often bloats the heap and at the point execjs is called there are extra v8 contexts sitting around in a bloated heap that just is too big to run a GC cause so much is free in it.
Trouble is a v8 context can easily consume 100+MB of RSS.
I was wondering if we could add to execjs a concept of "OK, I am done with the context"
Once that is called, MiniRacer could release the v8 context and reclaim all the memory. This means that usage wise if you want to reclaim memory early you would do:
context = ExecJS.compile(source)
context.call("CoffeeScript.compile", "square = (x) -> x * x", bare: true)
context.release
context.call("X") => raises error cause context is done and poison at this point.
Clearly implementation would be optional.
Thoughts ?
- 主要語言
- Ruby
- 星號
- 581
- 分支
- 285
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
rails/execjs 的其他 Issue
-
Runtime stderr is missing from ruby error message可能已有人在做 @arpitjain099 於 168 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 25/100
-
難度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
Bug Ruby Waiting for: Product Owner
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-ruby#3228 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
開発用DockerイメージにPlaywrightのシステム依存を追加する可能已有人在做 @momocus 今天認領。 未關閉
難度 1/5 1 小時以內 新手友好度 85/100
sakazuki-org/sakazuki#1453 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 76/100
jenkins-infra/jenkins.io#9615 · 1 則留言 ·
維護者通常 1 天內回覆