Skip to content

Commit

Permalink
8257569: Failure observed with JfrVirtualMemory::initialize
Browse files Browse the repository at this point in the history
Reviewed-by: egahlin, poonam
  • Loading branch information
mgronlun committed Feb 9, 2021
1 parent fef7514 commit 52c2a8f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
Expand Up @@ -214,6 +214,7 @@ class JfrVirtualMemoryManager : public JfrCHeapObj {
return reserved_high() == committed_high();
}

u1* top() const { return reinterpret_cast<u1*>(_current_segment->top()); }
const u1* committed_low() const { return _current_segment->committed_low(); }
const u1* committed_high() const { return _current_segment->committed_high(); }
const u1* reserved_low() const { return _current_segment->reserved_low(); }
Expand Down Expand Up @@ -444,11 +445,10 @@ void* JfrVirtualMemory::initialize(size_t reservation_size_request_bytes,
}
_reserved_low = (const u1*)_vmm->reserved_low();
_reserved_high = (const u1*)_vmm->reserved_high();
assert(static_cast<size_t>(_reserved_high - _reserved_low) == reservation_size_request_bytes, "invariant");
// reservation complete
_top = (u1*)_vmm->committed_high();
_commit_point = _top;
_top = _vmm->top();
assert(_reserved_low == _top, "invariant"); // initial empty state
assert((size_t)(_reserved_high - _reserved_low) == reservation_size_request_bytes, "invariant");
// initial commit
commit_memory_block();
return _top;
Expand All @@ -471,8 +471,6 @@ bool JfrVirtualMemory::is_empty() const {
bool JfrVirtualMemory::commit_memory_block() {
assert(_vmm != NULL, "invariant");
assert(!is_full(), "invariant");
assert(_top == _commit_point, "invariant");

void* const block = _vmm->commit(_physical_commit_size_request_words);
if (block != NULL) {
_commit_point = _vmm->committed_high();
Expand Down

0 comments on commit 52c2a8f

Please sign in to comment.