Service-runner optionally uses the heapdump package to save a heap dump on SIGUSR2. We used to directly require heapdump as a devDependency, but have since removed it & rely on npm to be present on the machines so that we can install it temporarily in case we need to debug a memory issue. The require of the package only happens in the signal handler, so things work fine if the package is not installed.
The reasons for why we no longer require heapdump by default are:
- It introduced a binary dependency that most third-party users don't need. Even we don't need it normally.
- Because it interfaces with V8 internals, the heapdump package is fairly specific to a node version, and often fails to work if compiled on a slightly different version of node. Since we don't have systematic building of dependencies & generally rely on doing this on developer laptops this often does not work.
- We need to install specific versions of the heapdump package for specific node versions. For example, latest heapdump does not work any more with the old node 0.10 version we are running. This means that heapdump often breaks the install for third-party users on different (often more current) node versions by failing to compile.
So, the question is:
- Should we switch back to installing heapdump by default?