Open
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
9.33.0
Framework Version
Next: 14.2.25
Link to Sentry event
No response
Reproduction Example/SDK Setup
// instrumentation-client.ts
Sentry.init({
dsn: process.env.NEXT_PUBLIC_DSN
sendDefaultPii: false,
beforeSend(event) {
event.tags = {
...event.tags,
};
return event;
},
tracesSampler: ({ name, inheritOrSampleWith, attributes }) => {
return inheritOrSampleWith(someOperations(name, attributes) ?? 0)
},
integrations: [Sentry.browserTracingIntegration()],
});
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
// instrumentation.ts
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./sentry.server.config");
}
}
// sentry.server.config.ts
Sentry.init({
dsn: env("NEXT_PUBLIC_DSN"),
sendDefaultPii: false,
beforeSend(event) {
event.tags = {
...event.tags,
};
return event;
},
tracesSampler: ({ name, inheritOrSampleWith }) => {
return inheritOrSampleWith(0);
},
});
Steps to Reproduce
npm run build
works perfectly with enabling sourcemap and uploading it to Sentry- When running the app on production (
npm run start
), I observe that there is a gradual uptrend for the memory usage of a pod. - Eventually, it reached the memory limit of a pod, causing the pod to be killed.
node -v // v22.17.0
Expected Result
Memory usage should not gradually increase over time
Actual Result
Fatal Error: Reached heap limit allocation failed javascript heap out of memory
Memory leak should not happen
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner