-
-
Notifications
You must be signed in to change notification settings - Fork 714
Closed
Description
Version
v20.2.0
Platform
Darwin Kamils-MacBook-Pro.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
- Git clone kamilkisiela/node-fetch-leak repo
- Steps to reproduce the memory leak are in
README.md
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Constant memory usage
What do you see instead?
Increase in memory (heap snapshots available)
Additional information
To reproduce the memory leak I created a simple node:http server that calls native fetch() on every incoming HTTP request.
I ran a load test against that server and measured the memory (heap snapshots available in the repository).
Next, I ran the same steps for Node v18.16 to compare the memory consumption.
It seems like Node v19, v20 are leaking but v18 seems stable.
| Requests made | v20.2 + fetch | v20.2 + undici v5.22.1 | v18.16 + fetch | v18.16 + undici v5.22.1 |
|---|---|---|---|---|
| ~300k | 16MB | 19MB | 9MB | 11MB |
| ~600k | 23MB | 26MB | 9MB | 11MB |
Node v20.2
Native fetch
| Requests made | Memory |
|---|---|
| 295k | 16MB |
| 575k | 23MB |
Undici v5.22.1
| Requests made | Memory |
|---|---|
| 365k | 19MB |
| 650k | 26MB |
Node v18.16
Native fetch
| Requests made | Memory |
|---|---|
| 360k | 9MB |
| 680k | 9MB |
Undici v5.22.1
| Requests made | Memory |
|---|---|
| 366k | 11MB |
| 678k | 11MB |
Related to nodejs/node#47936
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels