publicclass Main { publicstaticvoid main(String[] args) { // Reserve around 1/4 of the RAM for keeping objects live. long maxMem = Runtime.getRuntime().maxMemory();
Object[] holder = new Object[(int)maxMem / 16]; int count = 0; try { while (true) {
holder[count++] = new Object[1025]; // A bit over one page.
}
} catch (OutOfMemoryError e) {} for (int i = 0; i < count; ++i) {
holder[i] = null;
} // Make sure the heap can handle allocating large object array. This makes sure that free // pages are correctly coalesced together by the allocator.
holder[0] = new Object[(int)maxMem / 8];
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet am 2026-06-29)
¤
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.