This call is used to workaround a bug/limitation of MappedByteBuffer
(see JDK-
4724038). But CTFTrace.close() is called quite often
(for example, once per trace when closing an experiment), so it is not
the best place to call System.gc(). Instead, only call it when we are
about to delete/rename a trace.
Change-Id: Ib9b346dd04df4f64289ac9db0b976e6b70ff2551
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/25174
Tested-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
}
}
}
- // Invoke GC to release MappedByteBuffer objects (Java bug JDK-4724038)
- System.gc();
}
// ------------------------------------------------------------------------
TmfExperimentElement experiment = (TmfExperimentElement) getParent();
experiment.closeEditors();
}
+
+ /*
+ * We will be closing a trace shortly. Invoke GC to release
+ * MappedByteBuffer objects, which some trace types, like CTF, use.
+ * (see Java bug JDK-4724038)
+ */
+ System.gc();
}
/**