mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8065334: CodeHeap expansion fails although there is uncommitted memory
CodeHeap::expand_by() should commit remaining space if requested expansion size is too large. Reviewed-by: kvn
This commit is contained in:
parent
025890379a
commit
a5d7b2b450
1 changed files with 4 additions and 0 deletions
|
@ -149,6 +149,10 @@ bool CodeHeap::expand_by(size_t size) {
|
|||
// expand _memory space
|
||||
size_t dm = align_to_page_size(_memory.committed_size() + size) - _memory.committed_size();
|
||||
if (dm > 0) {
|
||||
// Use at least the available uncommitted space if 'size' is larger
|
||||
if (_memory.uncommitted_size() != 0 && dm > _memory.uncommitted_size()) {
|
||||
dm = _memory.uncommitted_size();
|
||||
}
|
||||
char* base = _memory.low() + _memory.committed_size();
|
||||
if (!_memory.expand_by(dm)) return false;
|
||||
on_code_mapping(base, dm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue