publicstaticvoid main(String[] args) { try { // With 4 characters in "language", we'll fill up a 16M heap quickly, // causing full GCs and SoftReference reclamation. Repeat at least two // times to verify no NPEs appear when looking up Locale's whose // softly referenced data in sun.util.locale.BaseLocale$Key might have // been cleared. for (int i = 0; i < 2; i++) { for (int j = 0; j < 512*1024; j++) {
Locale.of(HexFormat.of().toHexDigits((short)j));
}
}
} catch (OutOfMemoryError e) { // Can happen on some system configurations, and while increasing heap // size would allow GC to keep up, it also makes it impractically hard // to reproduce NPE issues that could arise when references are being // cleared.
// Do a System.gc() to not throw an OOME again in the jtreg wrapper.
System.gc();
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.