bun icon indicating copy to clipboard operation
bun copied to clipboard

Memory leak with prisma

Open lobomfz opened this issue 1 year ago • 4 comments

What version of Bun is running?

1.0.25+a8ff7be64

What platform is your computer?

Linux 6.6.9-zen1-1-zen x86_64 unknown

What steps can reproduce the bug?

Repeatedly calling prismaclient.findmany()

Example and reproduction steps here: https://github.com/lobomfz/prisma-bun-memleak

What is the expected behavior?

Memory usage should stabilize and lower after stress is done

What do you see instead?

Memory usage keeps grows from 150mb to 500mb in a few seconds and doesn't stop growing. Got to 10gb in less than an hour.

image

Additional information

This does not happen with Kysely and doesn't happen with node (if it does, to a negligible extent)

engineType = "binary" doesn't work at all

lobomfz avatar Jan 21 '24 21:01 lobomfz

Thanks for reporting this and the reproduction

Jarred-Sumner avatar Jan 22 '24 03:01 Jarred-Sumner

Related issues:

https://github.com/oven-sh/bun/issues/7864 https://github.com/oven-sh/bun/issues/7864

jontybrook avatar Feb 06 '24 20:02 jontybrook

Related issues:

#7864 #7864

Yes, we also encountered that issue and been running on 1.0.18 ever since 1.0.19 came out, but this memory leak occurs on all versions, including 1.0.18

lobomfz avatar Feb 06 '24 22:02 lobomfz