Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

8257569: Failure observed with JfrVirtualMemory::initialize #246

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
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