Closed usrtax closed 10 months ago
You are doing 'static stuff, any 'static stuff including &'static [u8] won't be dropped or freed until the application successfully exited.
I change code into
#[deno_bindgen]
fn add3(a: u64, b: u64) -> u64 {
a + b
}
memery still leak
1 mintues
2 mintues
Thanks for the report. This is a known issue, deno_bindgen leaks the buffer to JS land. The JS bindings should register a finalization callback to free the buffer.
deno 1.26.0 (release, x86_64-unknown-linux-gnu) v8 10.7.193.3 typescript 4.8.3
code is there https://github.com/usrtax/deno_bindgen_test
test code https://github.com/usrtax/deno_bindgen_test/blob/main/lib/test.js
run as begin
run 3mintues RES 1040M
run 10minutes RES 2177M
run 1hour RES 14.9G
Deno.memoryUsage doesn't seem to be very accurate, pay more attention to the memory usage in top