Skip to content
Permalink
Browse files
8257569: Failure observed with JfrVirtualMemory::initialize
Reviewed-by: egahlin, poonam
  • Loading branch information
Markus Grönlund committed Feb 9, 2021
1 parent 906faca commit f0bd9db5c763a742b5641e2b70f0c49f19d1d768
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
@@ -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(); }
@@ -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;
@@ -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();

0 comments on commit f0bd9db

Please sign in to comment.