-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in db.getMany()
#192
Labels
bug
Something isn't working
Comments
Could you write a simple (JS not TS) script to reproduce? |
This can be run on an empty database as well. It fills 5GB in 2 minutes and growing. |
Thanks, looking into it. Also reproduces on other implementations (that share code): const { ClassicLevel } = require('classic-level')
const db = new ClassicLevel('./db/' + Date.now())
const keys = new Array(2000).fill(0).map((_, i) => String(i))
;(async () => {
while (true) {
await db.getMany(keys)
console.log(process.memoryUsage().rss / 1024 / 1024)
}
})() |
vweevers
added a commit
to Level/classic-level
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
to Level/leveldown
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
to Level/leveldown
that referenced
this issue
Mar 24, 2022
vweevers
added a commit
to Level/leveldown
that referenced
this issue
Mar 25, 2022
vweevers
added a commit
that referenced
this issue
Mar 25, 2022
vweevers
added a commit
to Level/classic-level
that referenced
this issue
Mar 25, 2022
vweevers
added a commit
that referenced
this issue
Mar 25, 2022
Fixed in 5.2.1. Thanks for the report - and your Open Collective donation ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context:
OS: macOS 12.2.1
Chip: Apple M1 Pro
Node: v16.13.2
rocksdb: 5.2.0
level-rocksdb: 5.0.0
Db options:
I stress tested the
db.GetMany
method with batches of 500 keys as part of a simple node.js express app and after some time the memory usage of process was about 40GB and growing.I then replaced
getMany
withget
and the memory stabilised at about 300MB, with worse performance, of course.The problem reproduces 100%. Do you guys have ideas why this could happen?
cc: @vweevers pinging as I saw you added support for
getMany
.Thank you!
The text was updated successfully, but these errors were encountered: