You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was benchmarking Deno with K6 and noticed that some of my endpoints where using more and more memory over time. After some experimenting it seems to be only happening to those that returned an empty body:
Ref denoland/deno#27545.
Fixes a leak in deno.serve with an empty response. We would call
`to_string_ptr` with an empty string and then call alloc with a length
of 0 which is UB.
Instead of using `alloc` directly, which has a large number of
invariants to uphold, I've changed to just use `Vec` APIs. That leaves
us with fewer invariants to uphold, handles the tricky cases for us, and
we need to make a `Vec` eventually anyway (since `String` just wraps a
Vec).
Version: Deno 2.1.4
OS: Windows 11 Pro
I was benchmarking Deno with K6 and noticed that some of my endpoints where using more and more memory over time. After some experimenting it seems to be only happening to those that returned an empty body:
For convenience, here is an example K6 script to observe the issue:
The text was updated successfully, but these errors were encountered: