R
Railway2mo ago
Nulo

memory leak with bun --smol

project id: 4c5f2c27-8083-41b1-9c64-a648a88dc7e3 running a basic telegram bot with bun --smol. is there a way to debug this? i can't tell if my code, bun, or railway is in the wrong
Solution:
It's 100% related to your code and bun
Jump to solution
7 Replies
Percy
Percy2mo ago
Project ID: 4c5f2c27-8083-41b1-9c64-a648a88dc7e3
Solution
Medim
Medim2mo ago
It's 100% related to your code and bun
Medim
Medim2mo ago
railway can't cause a memory leak try testing locally/docker and see if the same happens
Nulo
NuloOP2mo ago
not so much railway causing a memory leak, but rather measuring it wrong. it has happened to me before (comparing it on railway vs the same dockerfile in a server)
Medim
Medim2mo ago
u can log console.log(heapStats()) with bun to see memory usaghe
Medim
Medim2mo ago
U can also set an envvar to print stats on program exit https://bun.sh/docs/project/benchmarking#native-heap-stats
Bun
Benchmarking – Project | Bun Docs
Bun is designed for performance. Learn how to benchmark Bun yourself.
Nulo
NuloOP2mo ago
thanks, this helps, i believe it's a bun node-compat problem
Want results from more Discord servers?
Add your server