When processing flat arrays, GCs are not splitting the work in chunks as they are doing for reference arrays. This could lead to performance issues when handling big flat arrays.
For instance, for G1:
inline void G1FullGCMarker::follow_object(oop obj) {
assert(_bitmap->is_marked(obj), "should be marked");
if (obj->is_refArray()) {
// Handle object arrays explicitly to allow them to
// be split into chunks if needed.
follow_array((objArrayOop)obj);
} else {
obj->oop_iterate(mark_closure());
}
}
Flat arrays are not refArrays(), they are then skipping the array specific processing.
Note that the arrays meta-data, for both flat and reference arrays are being refactored in https://github.com/openjdk/valhalla/pull/1452
Waiting for this PR to be integrated would avoid having to fix GCs twice.
For instance, for G1:
inline void G1FullGCMarker::follow_object(oop obj) {
assert(_bitmap->is_marked(obj), "should be marked");
if (obj->is_refArray()) {
// Handle object arrays explicitly to allow them to
// be split into chunks if needed.
follow_array((objArrayOop)obj);
} else {
obj->oop_iterate(mark_closure());
}
}
Flat arrays are not refArrays(), they are then skipping the array specific processing.
Note that the arrays meta-data, for both flat and reference arrays are being refactored in https://github.com/openjdk/valhalla/pull/1452
Waiting for this PR to be integrated would avoid having to fix GCs twice.