11/*
2- * Copyright (c) 2001, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2001, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -179,11 +179,11 @@ G1HeapRegion* G1CollectedHeap::new_region(size_t word_size,
179179 // safepoint.
180180 assert (SafepointSynchronize::is_at_safepoint (), " invariant" );
181181
182- log_debug (gc, ergo, heap)(" Attempt heap expansion (region allocation request failed). Allocation request: " SIZE_FORMAT " B " ,
182+ log_debug (gc, ergo, heap)(" Attempt heap expansion (region allocation request failed). Allocation request: %zuB " ,
183183 word_size * HeapWordSize);
184184
185185 assert (word_size * HeapWordSize < G1HeapRegion::GrainBytes,
186- " This kind of expansion should never be more than one region. Size: " SIZE_FORMAT ,
186+ " This kind of expansion should never be more than one region. Size: %zu " ,
187187 word_size * HeapWordSize);
188188 if (expand_single_region (node_index)) {
189189 // Given that expand_single_region() succeeded in expanding the heap, and we
@@ -335,7 +335,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(G1HeapRegion* first_h
335335}
336336
337337size_t G1CollectedHeap::humongous_obj_size_in_regions (size_t word_size) {
338- assert (is_humongous (word_size), " Object of size " SIZE_FORMAT " must be humongous here" , word_size);
338+ assert (is_humongous (word_size), " Object of size %zu must be humongous here" , word_size);
339339 return align_up (word_size, G1HeapRegion::GrainWords) / G1HeapRegion::GrainWords;
340340}
341341
@@ -358,7 +358,7 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size) {
358358 humongous_start = _hrm.expand_and_allocate_humongous (obj_regions);
359359 if (humongous_start != nullptr ) {
360360 // We managed to find a region by expanding the heap.
361- log_debug (gc, ergo, heap)(" Heap expansion (humongous allocation request). Allocation request: " SIZE_FORMAT " B " ,
361+ log_debug (gc, ergo, heap)(" Heap expansion (humongous allocation request). Allocation request: %zuB " ,
362362 word_size * HeapWordSize);
363363 policy ()->record_new_heap_size (num_regions ());
364364 } else {
@@ -444,7 +444,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
444444 return result;
445445 }
446446
447- log_trace (gc, alloc)(" %s: Unsuccessfully scheduled collection allocating " SIZE_FORMAT " words" ,
447+ log_trace (gc, alloc)(" %s: Unsuccessfully scheduled collection allocating %zu words" ,
448448 Thread::current ()->name (), word_size);
449449
450450 // We can reach here if we were unsuccessful in scheduling a collection (because
@@ -462,7 +462,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
462462 // Give a warning if we seem to be looping forever.
463463 if ((QueuedAllocationWarningCount > 0 ) &&
464464 (try_count % QueuedAllocationWarningCount == 0 )) {
465- log_warning (gc, alloc)(" %s: Retried allocation %u times for " SIZE_FORMAT " words" ,
465+ log_warning (gc, alloc)(" %s: Retried allocation %u times for %zu words" ,
466466 Thread::current ()->name (), try_count, word_size);
467467 }
468468 }
@@ -495,8 +495,8 @@ HeapWord* G1CollectedHeap::alloc_archive_region(size_t word_size, HeapWord* pref
495495 MemRegion reserved = _hrm.reserved ();
496496
497497 if (reserved.word_size () <= word_size) {
498- log_info (gc, heap)(" Unable to allocate regions as archive heap is too large; size requested = " SIZE_FORMAT
499- " bytes, heap = " SIZE_FORMAT " bytes" , word_size, reserved.word_size ());
498+ log_info (gc, heap)(" Unable to allocate regions as archive heap is too large; size requested = %zu "
499+ " bytes, heap = %zu bytes" , word_size, reserved.word_size ());
500500 return nullptr ;
501501 }
502502
@@ -514,7 +514,7 @@ HeapWord* G1CollectedHeap::alloc_archive_region(size_t word_size, HeapWord* pref
514514 }
515515 increase_used (word_size * HeapWordSize);
516516 if (commits != 0 ) {
517- log_debug (gc, ergo, heap)(" Attempt heap expansion (allocate archive regions). Total size: " SIZE_FORMAT " B " ,
517+ log_debug (gc, ergo, heap)(" Attempt heap expansion (allocate archive regions). Total size: %zuB " ,
518518 G1HeapRegion::GrainWords * HeapWordSize * commits);
519519 }
520520
@@ -573,7 +573,7 @@ void G1CollectedHeap::dealloc_archive_regions(MemRegion range) {
573573 iterate_regions_in_range (range, dealloc_archive_region);
574574
575575 if (shrink_count != 0 ) {
576- log_debug (gc, ergo, heap)(" Attempt heap shrinking (CDS archive regions). Total size: " SIZE_FORMAT " B " ,
576+ log_debug (gc, ergo, heap)(" Attempt heap shrinking (CDS archive regions). Total size: %zuB " ,
577577 G1HeapRegion::GrainWords * HeapWordSize * shrink_count);
578578 // Explicit uncommit.
579579 uncommit_regions (shrink_count);
@@ -673,7 +673,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size) {
673673 return result;
674674 }
675675
676- log_trace (gc, alloc)(" %s: Unsuccessfully scheduled collection allocating " SIZE_FORMAT " " ,
676+ log_trace (gc, alloc)(" %s: Unsuccessfully scheduled collection allocating %zu " ,
677677 Thread::current ()->name (), word_size);
678678
679679 // We can reach here if we were unsuccessful in scheduling a collection (because
@@ -978,7 +978,7 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size) {
978978 _verifier->verify_region_sets_optional ();
979979
980980 size_t expand_bytes = MAX2 (word_size * HeapWordSize, MinHeapDeltaBytes);
981- log_debug (gc, ergo, heap)(" Attempt heap expansion (allocation request failed). Allocation request: " SIZE_FORMAT " B " ,
981+ log_debug (gc, ergo, heap)(" Attempt heap expansion (allocation request failed). Allocation request: %zuB " ,
982982 word_size * HeapWordSize);
983983
984984
@@ -995,7 +995,7 @@ bool G1CollectedHeap::expand(size_t expand_bytes, WorkerThreads* pretouch_worker
995995 size_t aligned_expand_bytes = os::align_up_vm_page_size (expand_bytes);
996996 aligned_expand_bytes = align_up (aligned_expand_bytes, G1HeapRegion::GrainBytes);
997997
998- log_debug (gc, ergo, heap)(" Expand the heap. requested expansion amount: " SIZE_FORMAT " B expansion amount: " SIZE_FORMAT " B " ,
998+ log_debug (gc, ergo, heap)(" Expand the heap. requested expansion amount: %zuB expansion amount: %zuB " ,
999999 expand_bytes, aligned_expand_bytes);
10001000
10011001 if (is_maximal_no_gc ()) {
@@ -1042,7 +1042,7 @@ void G1CollectedHeap::shrink_helper(size_t shrink_bytes) {
10421042 uint num_regions_removed = _hrm.shrink_by (num_regions_to_remove);
10431043 size_t shrunk_bytes = num_regions_removed * G1HeapRegion::GrainBytes;
10441044
1045- log_debug (gc, ergo, heap)(" Shrink the heap. requested shrinking amount: " SIZE_FORMAT " B aligned shrinking amount: " SIZE_FORMAT " B actual amount shrunk: " SIZE_FORMAT " B " ,
1045+ log_debug (gc, ergo, heap)(" Shrink the heap. requested shrinking amount: %zuB aligned shrinking amount: %zuB actual amount shrunk: %zuB " ,
10461046 shrink_bytes, aligned_shrink_bytes, shrunk_bytes);
10471047 if (num_regions_removed > 0 ) {
10481048 log_debug (gc, heap)(" Uncommittable regions after shrink: %u" , num_regions_removed);
@@ -2117,12 +2117,12 @@ void G1CollectedHeap::print_on(outputStream* st) const {
21172117 p2i (_hrm.reserved ().start ()),
21182118 p2i (_hrm.reserved ().end ()));
21192119 st->cr ();
2120- st->print (" region size " SIZE_FORMAT " K , " , G1HeapRegion::GrainBytes / K);
2120+ st->print (" region size %zuK , " , G1HeapRegion::GrainBytes / K);
21212121 uint young_regions = young_regions_count ();
2122- st->print (" %u young (" SIZE_FORMAT " K ), " , young_regions,
2122+ st->print (" %u young (%zuK ), " , young_regions,
21232123 (size_t ) young_regions * G1HeapRegion::GrainBytes / K);
21242124 uint survivor_regions = survivor_regions_count ();
2125- st->print (" %u survivors (" SIZE_FORMAT " K )" , survivor_regions,
2125+ st->print (" %u survivors (%zuK )" , survivor_regions,
21262126 (size_t ) survivor_regions * G1HeapRegion::GrainBytes / K);
21272127 st->cr ();
21282128 if (_numa->is_enabled ()) {
@@ -2774,7 +2774,7 @@ void G1CollectedHeap::increase_used(size_t bytes) {
27742774
27752775void G1CollectedHeap::decrease_used (size_t bytes) {
27762776 assert (_summary_bytes_used >= bytes,
2777- " invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT ,
2777+ " invariant: _summary_bytes_used: %zu should be >= bytes: %zu " ,
27782778 _summary_bytes_used, bytes);
27792779 _summary_bytes_used -= bytes;
27802780}
0 commit comments