#High memory usage with NestJS

1 messages · Page 1 of 1 (latest)

open chasm
#

I'm noticing really high memory usage when using bun to run an empty NestJS project, about 2x what node uses, is this an issue or am I mistaken about how I'm measuring it ?

Here are the steps to reproduce

  • bun x @nestjs/cli new bun-mem-test (after it creates the necessary files just CTRL+C to stop npm from taking too long installing the dependencies and install them with bun instead looooool )
  • cd bun-mem-test
  • bun run build (build the app)
  • node dist/main.js or bun dist/main.js to run it
    (that's it for now, there's no requests or anything, just the NestJS app listening for requests)

I'm using this simple script to monitor the memory (vmRSS) usage ```sh
#!/bin/sh

usage: ./mem.sh <pid>

PID=$1
while true; do
cat /proc/$PID/status | grep -i vmrss | awk '{print $2}'
sleep 0.5
done

node uses about 69000-72000 kB, while bun uses 119000-122000 kB
civic oracle
#

I think there is a memory leak somewhere