1 comment

[ 3.3 ms ] story [ 15.3 ms ] thread
I recently experienced the mother of all memory leaks relating to pm2. The daemon's heap usage was fine but the memory was not being released back to the system resulting in the heap about 15mb while the process was squatting on around 250+GB of RAM. Turned out switching the daemon processes to jemalloc fixed the leak.

I figure the more node programs using jemalloc the better so I asked ChatGPT to help me create an npm package to easily identify if, and where, jemalloc is installed on a machine.

ChatGPT did almost all of the work in the initial commit, including the readme & picking the name for the package.

Subsequent commits were by me fixing small bugs here and there. All in all, I'm very impressed with the technology.