Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8236359 | 15 | Claes Redestad | P4 | Resolved | Fixed | team |
VectorSet::clear purportedly frees allocated storages for the backing array if the array is large enough (100 32-bit words). Since the array is allocated in a resource arena, then unless the VectorSet::_data array is at the current end of the arena then freeing will be a no-op and the "freed" memory will remain allocated in an unusable state until the arena usage is reclaimed at the next ResourceMark. Any subsequent growth of the backing array will claim new storage at the end of the arena.
To avoid this kind of fragmentation it might be better to keep the backing array around, maintaining both current _size along with a _max (the actually allocated size) so that we don't excessively clear memory we're not using.
To avoid this kind of fragmentation it might be better to keep the backing array around, maintaining both current _size along with a _max (the actually allocated size) so that we don't excessively clear memory we're not using.
- backported by
-
JDK-8236359 VectorSet::clear can cause fragmentation
-
- Resolved
-