Memory leak problem

linux memory keep increasing /.prisma/client/query-engine-debian-openssl-3.0.x anyone facing this problem? im using expressjs
6 Replies
Prisma AI Help
Prisma AI Help2mo ago
Skipping coffee for instant knowledge! Let's brew that AI answer now. Yes, many users have reported memory leak issues with Prisma on Linux, where the memory usage of the process /.prisma/client/query-engine-debian-openssl-3.0.x keeps increasing over time, especially under heavy or continuous query loads. This problem has been observed in various environments, including Express.js apps, and is not limited to a specific Node.js version or Prisma version. Key points from user reports: - The memory leak is slow but persistent, causing containers or servers to eventually run out of memory and crash or require regular restarts. This is visible both when using the "library" and "binary" engine types, but the leak is often more pronounced with the binary engine. The Node.js heap remains stable, but the overall RSS (resident set size) memory grows steadily, indicating the leak is outside the JS heap, likely in the native query engine process itself Prisma Memory Leak when using in NestJS app, reported by Jest. - The issue is reproducible with high query volumes, but also occurs with regular workloads. Some users have provided reproduction repositories and memory usage charts showing the steady increase in memory usage over time. - Downgrading to Prisma 4.8.1 has helped some users avoid the leak, but this is not a long-term solution as it prevents access to new features and fixes Unexpectedly high memory usage when executing large number of upsert statements. - Upgrading Node.js to v20 has reduced the rate of memory growth for some, but not all, users. The leak still exists, just at a slower rate for some workloads Prisma Memory Leak when using in NestJS app, reported by Jest. - The Prisma team is aware of the issue and is investigating, but there is no definitive fix yet. If you are facing this, consider: - Monitoring RSS memory, not just heap. - Restarting your service periodically as a t emporary workaround. - Testing with different Prisma and Node.js versions. - Following or contributing to the ongoing GitHub issues for updates and possible fixes. You are not alone—this is a known and actively discussed problem in the Prisma community. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Anonymous
AnonymousOP2mo ago
sample, already tried with singleton prisma, but still keep increasing this memory command
No description
Anonymous
AnonymousOP2mo ago
engineType = "binary" binaryTargets = ["native", "windows", "debian-openssl-3.0.x"] this causing the problem
Nurul
Nurul2mo ago
Can you try with latest prisma version and check if you still run into the same error?
Anonymous
AnonymousOP2mo ago
yes, i am using latest prisma version still having same error
Nurul
Nurul2mo ago
Hmm, strange! Would it be possible for you to provide a minimal reproduction?

Did you find this page helpful?