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
Markus Grönlund committed Feb 9, 2021
1 parent 906faca commit f0bd9db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,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 @@ -443,11 +444,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 @@ -470,8 +470,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

1 comment on commit f0bd9db

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.