This adds a planner event to request V8 heap statistics.
This data is gathered from the JS side because the related methods from the rust side require a &mut access to the runtime, which is impossible since it already runs in an infinite loop.
Since we elected to not run the prelude parts of deno which register functions like Deno.memory_usage, we intern the op_runtime_memory_usage function and import it directly as a host function, as we've done already with op_crypto_get_random_values. To avoid hosting too much code, the rss field is not filled (it needs platform specific functions), since that info can generally be obtained by other means.
This adds a planner event to request V8 heap statistics.
This data is gathered from the JS side because the related methods from the rust side require a
&mut
access to the runtime, which is impossible since it already runs in an infinite loop. Since we elected to not run the prelude parts of deno which register functions likeDeno.memory_usage
, we intern the op_runtime_memory_usage function and import it directly as a host function, as we've done already withop_crypto_get_random_values
. To avoid hosting too much code, therss
field is not filled (it needs platform specific functions), since that info can generally be obtained by other means.