-
-
Notifications
You must be signed in to change notification settings - Fork 362
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
A memory leak occurs when converting a promise from an Unknown object using Promise::from_unknown. According to the memory profiler, the leak appears to be associated to the invocation of napi_call_function in Deno.
The following example reproduces the issue.
#[napi]
pub fn leak_from_promise<'e>(unknown: Unknown<'e>) -> Result<()> {
if unknown.is_promise()? {
Promise::<Undefined>::from_unknown(unknown)?;
}
Ok(())
}Repeatedly calling leakFromPromise() results in a gradual increase of RSS memory.
setInterval(() => {
leakFromPromise(Promise.resolve())
}, 10)Interestingly, this behavior does not occur in Node.js.
Deno version: 2.5.0
napi-rs version: 3.3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working