Clean up promises after resolving (#52656)
Long-hanging promises are retaining the closure context where it's being `await`'ed even it's resolved already. You can tell it from this screenshot: <img width="1822" alt="CleanShot 2023-07-13 at 18 09 11@2x" src="https://github.com/vercel/next.js/assets/3676859/1d6210b0-16ba-440e-a8b6-c8c4343f4850"> In some cases, the entire `req` object is retained because of that. This increases the memory usage a bit. So this PR changes these promises to be cleaned up after they got resolved. Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment