-1

When I run node with the command node ./bin/www, task manager looks like this after 10 seconds (note that I made a setInterval returning process.memoryUsage() every 5 seconds): Task Manager Screenshot 1

But, when I run node using nodemon with the command nodemon ./bin/www, task manager looks like this: Task Manager Screenshot 2

  • Question: why nodemon is using that much memory and cpu?
1
  • I don't understand the -1 on my question. I don't know if I did something wrong or there is missing information. If that's the case, I'm not doing it on purpose
    – thorstorm
    Jul 20, 2016 at 17:52

1 Answer 1

0

After some trying and error, I've found the reason why:

Nodemon was taken that much RAM because it was watching for changes in the main directory, which contained a big image folder (almost 7GB). I think Nodemon has to load the files content that are being watched into RAM to know when a file has changed. That's my guess.

Anyway, I've created a nodemon.json file to ignore the images folder which contains the following:

nodemon.json

{
 "ignore": ["/public/images/*"]
}

I placed nodemon.json in the app's root directory and now everything works as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .