Skip to content
Permalink
Browse files
8247421: [TESTBUG] ReturnBlobToWrongHeapTest.java failed allocating blob
Backport-of: bf300e8
  • Loading branch information
shipilev committed Jun 25, 2021
1 parent df587c7 commit 66d4ee994eaa6046c67824b12f44c5781ff8e6a9
Showing with 11 additions and 2 deletions.
  1. +11 −2 test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java
@@ -64,13 +64,22 @@ private static void free(long address) {

public static void main(String[] args) {
if (codeCacheMinBlockLength == 1) {
// start with allocating a small block
long firstSegmentSizedAddress = 0;
firstSegmentSizedAddress = allocate(0);
if (firstSegmentSizedAddress == 0) {
throw new RuntimeException("Test failed: Failed allocating first segment-sized blob");
}

// Fill first code heap with large blobs until allocation fails.
long address;
while ((address = allocate((int)largeBlobSize)) != 0) {
}

// Allocate segment-sized blocks in first code heap.
long lastSegmentSizedAddress = 0; // Address of the last segment-sized blob allocated
// Allocate segment-sized blocks in first code heap until it runs out
// Remember the last one
// Use the pre-allocated one as backup if the code cache is already completely full.
long lastSegmentSizedAddress = firstSegmentSizedAddress;
while ((address = allocate(0)) != 0) {
lastSegmentSizedAddress = address;
}

1 comment on commit 66d4ee9

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 66d4ee9 Jun 25, 2021

Please sign in to comment.