File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
test/hotspot/jtreg/compiler/codecache/stress Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,22 @@ private static void free(long address) {
6464
6565 public static void main (String [] args ) {
6666 if (codeCacheMinBlockLength == 1 ) {
67+ // start with allocating a small block
68+ long firstSegmentSizedAddress = 0 ;
69+ firstSegmentSizedAddress = allocate (0 );
70+ if (firstSegmentSizedAddress == 0 ) {
71+ throw new RuntimeException ("Test failed: Failed allocating first segment-sized blob" );
72+ }
73+
6774 // Fill first code heap with large blobs until allocation fails.
6875 long address ;
6976 while ((address = allocate ((int )largeBlobSize )) != 0 ) {
7077 }
7178
72- // Allocate segment-sized blocks in first code heap.
73- long lastSegmentSizedAddress = 0 ; // Address of the last segment-sized blob allocated
79+ // Allocate segment-sized blocks in first code heap until it runs out
80+ // Remember the last one
81+ // Use the pre-allocated one as backup if the code cache is already completely full.
82+ long lastSegmentSizedAddress = firstSegmentSizedAddress ;
7483 while ((address = allocate (0 )) != 0 ) {
7584 lastSegmentSizedAddress = address ;
7685 }
You can’t perform that action at this time.
0 commit comments