Skip to content

Communicate JS memory pressure or GC to .NET WASM #92434

Answered by kg
SerratedSharp asked this question in Ideas
Discussion options

You must be logged in to vote

Realistically speaking the solution to this is more robust cross-language GC integration. If you want to communicate memory pressure to .NET you need to know "how much" to communicate, and now you are reliant on .NET to not change its pressure thresholds/logic for GCs to happen when you want them. If they happen at the wrong times your app will feel unresponsive and freeze. For your scenario it may be most appropriate to just trigger a managed GC periodically on a timer to free unused resources.

In the long run we may be able to utilize WASM GC integration to hold onto JS objects directly somehow in a way that would alleviate this problem, but I'm not sure when/if that will happen due to …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

kg
Sep 22, 2023
Collaborator

You must be logged in to vote
0 replies
Answer selected by SerratedSharp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm
3 participants