Skip to content

Lazily create Timer to avoid creating not needed threads #2115

Description

@marandaneto

Description

ThreadPools> 12887 total threads. Threadpools with more than 5 threads: Timer (12711 threads)

Which led to:

app/worker.7 java.lang.OutOfMemoryError: unable to create new native
app/worker.7 at java.lang.Thread.start0(Native Method)
app/worker.7 at java.lang.Thread.start(Thread.java:719)
app/worker.7 at java.util.Timer.(Timer.java:176)
app/worker.7 at java.util.Timer.(Timer.java:146)
app/worker.7 at io.sentry.SentryTracer.(SentryTracer.java:68)

private final @NotNull Timer timer = new Timer(true);

SentryTracer#timer only if idleTimeout != null apparently.

Also LifecycleWatcher#timer only if enableSessionTracking is enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance API issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions