After upgrading to @pyroscope/nodejs version 0.4.3, our Next.js application starts freezing after a while, even though system resources (CPU, memory) are normal and there's no indication of resource exhaustion. The application works fine with version 0.3.9.
This issue occurs only in Next.js applications. When running a standard Node.js app with the same version of Pyroscope, no issues are observed.
Steps to reproduce:
Install @pyroscope/nodejs version 0.4.3.
Initialize the Pyroscope client in a Next.js application using:
const pyroscope = require('@pyroscope/nodejs');
pyroscope.init({
serverAddress: 'http://someaddress,
appName: 'my-next-app',
});
The application starts freezing after some time (around 40 minutes) without any significant resource usage, causing unresponsiveness.
Environment:
Node.js version: 22.2.0
Next.js version: 14.2.11
Pyroscope does not output any relevant logs in the console during the freeze. The last log entries before the freeze are:
pyroscope::profiler::wall profile +1m
pyroscope::profiler::heap profile +1m