Skip to content

Commit 3932a4f

Browse files
[GR-65564] Rethrow OutOfMemoryErrors that happen during performance data initialization.
PullRequest: graal/21022
2 parents b500bf9 + 16eeb62 commit 3932a4f

File tree

1 file changed

+7
-2
lines changed
  • substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jvmstat

1 file changed

+7
-2
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jvmstat/PerfManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import com.oracle.svm.core.locks.VMMutex;
4545
import com.oracle.svm.core.option.HostedOptionKey;
4646
import com.oracle.svm.core.option.RuntimeOptionKey;
47+
import com.oracle.svm.core.thread.RecurringCallbackSupport;
4748
import com.oracle.svm.core.util.VMError;
4849

4950
import jdk.graal.compiler.options.Option;
@@ -184,8 +185,9 @@ private static class PerfDataThread extends Thread {
184185

185186
@Override
186187
public void run() {
187-
initializeMemory();
188+
RecurringCallbackSupport.suspendCallbackTimer("Performance data thread must not execute recurring callbacks.");
188189

190+
initializeMemory();
189191
try {
190192
sampleData();
191193
ImageSingletons.lookup(PerfMemory.class).setAccessible();
@@ -213,8 +215,11 @@ private void initializeMemory() {
213215

214216
initialized = true;
215217
initializationCondition.broadcast();
218+
} catch (OutOfMemoryError e) {
219+
/* For now, we can only rethrow the error to terminate the thread (see GR-40601). */
220+
throw e;
216221
} catch (Throwable e) {
217-
VMError.shouldNotReachHere(ERROR_DURING_INITIALIZATION, e);
222+
throw VMError.shouldNotReachHere(ERROR_DURING_INITIALIZATION, e);
218223
} finally {
219224
initializationMutex.unlock();
220225
}

0 commit comments

Comments
 (0)