This instructions allow you to take periodical heapdumps. To use in your project, first install heapdump, then add the following code to your app just after requiring 'fs'.