Skip to content

@sentry/ember leaks memory in tests #7258

@runspired

Description

@runspired

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/ember

SDK Version

7.38.0

Framework Version

4.10.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
		enabled: environment === 'production',
		dsn,
		environment,
		integrations: [new BrowserTracing()],
		tracesSampleRate: 0.01,
		release: `a string`,
});

Steps to Reproduce

run a series of acceptance tests, take a heap snapshot once tests are completed, examine retainers. You may want to use https://github.com/dnachev/heapdump-cleanup to cleanup WeakMap retainers to get a clear view.

Expected Result

No retained app instances.

Actual Result

Retained App instance per-acceptance-test due to instrumentation.

image (13)

image (12)

I was able to resolve this for now by removing performance instrumentation (we were barely using it even in prod). Others hitting this will want to ensure that at least the following is true in test and development environments in config/environment.js

ENV = {
  '@sentry/ember': {
    disablePerformance: true,
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: emberIssues related to the Sentry Ember SDK
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions