// The size is big to not fit into survive space. staticfinal Object[] cache = new Object[(surv_size / card_size)];
publicstaticvoid main(String[] args) {
masterA = new Test8010927[one_card];
masterB = new Object[one_card]; for (int i = 0; i < one_card; ++i) {
masterA[i] = elem;
masterB[i] = elem;
}
// Move cache[] to the old gen. long low_limit = wb.getObjectAddress(cache);
System.gc(); // Move 'cache' to oldgen. long upper_limit = wb.getObjectAddress(cache); if ((low_limit - upper_limit) > 0) { // substaction works with unsigned values // OldGen is placed before youngger for ParallelOldGC.
upper_limit = low_limit + 21000000l; // +20971520
} // Each A[one_card] size is 512 bytes, // it will take about 40000 allocations to trigger GC. // cache[] has 8192 elements so GC should happen // each 5th iteration. for (long l = 0; l < 20; l++) {
fill_heap(); if (debug) {
System.out.println("test oop_disjoint_arraycopy");
}
testA_arraycopy(); if (debug) {
System.out.println("test checkcast_arraycopy");
}
testB_arraycopy(); // Execute arraycopy to the topmost array in young gen if (debug) { int top_index = get_top_address(low_limit, upper_limit); if (top_index >= 0) { long addr = wb.getObjectAddress(cache[top_index]);
System.out.println("top_addr: 0x" + Long.toHexString(addr) + ", 0x" + Long.toHexString(addr + 512));
}
}
}
}
staticvoid fill_heap() { for (int i = 0; i < cache.length; ++i) {
o = new Test8010927[one_card];
System.arraycopy(masterA, 0, o, 0, masterA.length);
cache[i] = o;
} for (long j = 0; j < 256; ++j) {
o = newLong[10000]; // to trigger GC
}
}
staticvoid testA_arraycopy() { for (int i = 0; i < cache.length; ++i) {
System.arraycopy(masterA, 0, cache[i], 0, masterA.length);
}
}
staticvoid testB_arraycopy() { for (int i = 0; i < cache.length; ++i) {
System.arraycopy(masterB, 0, cache[i], 0, masterB.length);
}
}
staticint get_top_address(long min, long max) { int index = -1; long addr = min; for (int i = 0; i < cache.length; ++i) { long test = wb.getObjectAddress(cache[i]); if (((test - addr) > 0) && ((max - test) > 0)) { // substaction works with unsigned values
addr = test;
index = i;
}
} return index;
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-10-01)
¤
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.