Skip to content

Commit 8b7e489

Browse files
committed
add comment/todo for deleteOnExit
1 parent 536ffb7 commit 8b7e489

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sentry-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ private void stop(final boolean restartProfiler) {
273273
// the data in a list and send it when the next chunk is finished.
274274
try (final @NotNull ISentryLifecycleToken ignored2 = payloadLock.acquire()) {
275275
File jfrFile = new File(filename);
276+
// TODO: should we add deleteOnExit() here to let the JVM clean up the file?
277+
// as in `Sentry.java` `initJvmContinuousProfiling` each time we start the profiler we
278+
// create a new
279+
// temp directory/file that we can't cleanup on restart. Unless the user sets
280+
// `profiling-traces-dir-path` manually
281+
// jfrFile.deleteOnExit();
276282
payloadBuilders.add(
277283
new ProfileChunk.Builder(
278284
profilerId,

0 commit comments

Comments
 (0)