--- old/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp 2014-06-18 08:47:16.227242766 +0200 +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp 2014-06-18 08:47:16.123244295 +0200 @@ -2659,7 +2659,7 @@ if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks); n_blks += CMSOldPLABReactivityFactor*multiple*n_blks; - n_blks = MIN2(n_blks, CMSOldPLABMax); + n_blks = MIN2(n_blks, (size_t)CMSOldPLABMax); } assert(n_blks > 0, "Error"); _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl); --- old/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2014-06-18 08:47:16.763234889 +0200 +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2014-06-18 08:47:16.655236476 +0200 @@ -951,7 +951,7 @@ if (free_percentage < desired_free_percentage) { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); assert(desired_capacity >= capacity(), "invalid expansion size"); - size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes); + size_t expand_bytes = MAX2(desired_capacity - capacity(), (size_t)MinHeapDeltaBytes); if (PrintGCDetails && Verbose) { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); gclog_or_tty->print_cr("\nFrom compute_new_size: "); @@ -6556,7 +6556,7 @@ HeapWord* curAddr = _markBitMap.startWord(); while (curAddr < _markBitMap.endWord()) { size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr); - MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining)); + MemRegion chunk(curAddr, MIN2((size_t)CMSBitMapYieldQuantum, remaining)); _markBitMap.clear_large_range(chunk); if (ConcurrentMarkSweepThread::should_yield() && !foregroundGCIsActive() && @@ -6855,7 +6855,7 @@ return; } // Double capacity if possible - size_t new_capacity = MIN2(_capacity*2, MarkStackSizeMax); + size_t new_capacity = MIN2(_capacity*2, (size_t)MarkStackSizeMax); // Do not give up existing stack until we have managed to // get the double capacity that we desired. ReservedSpace rs(ReservedSpace::allocation_align_size_up( --- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-06-18 08:47:17.280227292 +0200 +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-06-18 08:47:17.171228893 +0200 @@ -3771,7 +3771,7 @@ // of things to do) or totally (at the very end). size_t target_size; if (partially) { - target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize); + target_size = MIN2((_task_queue->max_elems()/3), GCDrainStackTargetSize); } else { target_size = 0; } --- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-06-18 08:47:17.738220561 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-06-18 08:47:17.628222178 +0200 @@ -1733,7 +1733,7 @@ verify_region_sets_optional(); - size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); + size_t expand_bytes = MAX2(word_size * HeapWordSize, (size_t)MinHeapDeltaBytes); ergo_verbose1(ErgoHeapSizing, "attempt heap expansion", ergo_format_reason("allocation request failed") --- old/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp 2014-06-18 08:47:18.235213258 +0200 +++ new/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp 2014-06-18 08:47:18.096215301 +0200 @@ -38,7 +38,7 @@ _cancel(false), _empty(true), _dropped(0) { - _nqueues = MAX2(ParallelGCThreads, (size_t)1); + _nqueues = MAX2(ParallelGCThreads, (uintx)1); _queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC); for (size_t i = 0; i < _nqueues; i++) { new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size); --- old/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp 2014-06-18 08:47:18.647207204 +0200 +++ new/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp 2014-06-18 08:47:18.521209055 +0200 @@ -110,7 +110,7 @@ }; G1StringDedupEntryCache::G1StringDedupEntryCache() { - _nlists = MAX2(ParallelGCThreads, (size_t)1); + _nlists = MAX2(ParallelGCThreads, (uintx)1); _lists = PaddedArray::create_unfreeable((uint)_nlists); } --- old/src/share/vm/gc_implementation/g1/heapRegion.cpp 2014-06-18 08:47:19.038201458 +0200 +++ new/src/share/vm/gc_implementation/g1/heapRegion.cpp 2014-06-18 08:47:18.935202971 +0200 @@ -162,7 +162,7 @@ if (FLAG_IS_DEFAULT(G1HeapRegionSize)) { size_t average_heap_size = (initial_heap_size + max_heap_size) / 2; region_size = MAX2(average_heap_size / TARGET_REGION_NUMBER, - (uintx) MIN_REGION_SIZE); + (size_t) MIN_REGION_SIZE); } int region_size_log = log2_long((jlong) region_size); --- old/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2014-06-18 08:47:19.436195609 +0200 +++ new/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp 2014-06-18 08:47:19.333197123 +0200 @@ -194,7 +194,7 @@ const size_t num_overflow_elems = of_stack->size(); const size_t space_available = queue->max_elems() - queue->size(); const size_t num_take_elems = MIN3(space_available / 4, - ParGCDesiredObjsFromOverflowList, + (size_t)ParGCDesiredObjsFromOverflowList, num_overflow_elems); // Transfer the most recent num_take_elems from the overflow // stack to our work queue. --- old/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2014-06-18 08:47:19.848189555 +0200 +++ new/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2014-06-18 08:47:19.740191142 +0200 @@ -911,8 +911,8 @@ void PSParallelCompact::initialize_dead_wood_limiter() { const size_t max = 100; - _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0; - _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0; + _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0; + _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0; _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev); DEBUG_ONLY(_dwl_initialized = true;) _dwl_adjustment = normal_distribution(1.0); --- old/src/share/vm/memory/collectorPolicy.cpp 2014-06-18 08:47:20.270183353 +0200 +++ new/src/share/vm/memory/collectorPolicy.cpp 2014-06-18 08:47:20.166184882 +0200 @@ -392,7 +392,7 @@ uintx calculated_size = NewSize + OldSize; double shrink_factor = (double) MaxHeapSize / calculated_size; uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment); - FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size)); + FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), (size_t)smaller_new_size)); _initial_young_size = NewSize; // OldSize is already aligned because above we aligned MaxHeapSize to @@ -457,7 +457,7 @@ // yield a size that is too small) and bound it by MaxNewSize above. // Ergonomics plays here by previously calculating the desired // NewSize and MaxNewSize. - _max_young_size = MIN2(MAX2(_max_young_size, _initial_young_size), MaxNewSize); + _max_young_size = MIN2(MAX2(_max_young_size, _initial_young_size), (size_t)MaxNewSize); } // Given the maximum young size, determine the initial and @@ -487,7 +487,7 @@ // NewSize as the floor, because if NewRatio is overly large, the resulting // size can be too small. _initial_young_size = - MIN2(_max_young_size, MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize)); + MIN2(_max_young_size, MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize)); } } --- old/src/share/vm/memory/metaspace.cpp 2014-06-18 08:47:20.667177519 +0200 +++ new/src/share/vm/memory/metaspace.cpp 2014-06-18 08:47:20.562179062 +0200 @@ -1431,7 +1431,7 @@ void MetaspaceGC::post_initialize() { // Reset the high-water mark once the VM initialization is done. - _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize); + _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), (size_t)MetaspaceSize); } bool MetaspaceGC::can_expand(size_t word_size, bool is_class) { @@ -1491,7 +1491,7 @@ (size_t)MIN2(min_tmp, double(max_uintx)); // Don't shrink less than the initial generation size minimum_desired_capacity = MAX2(minimum_desired_capacity, - MetaspaceSize); + (size_t)MetaspaceSize); if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: "); @@ -1547,7 +1547,7 @@ const double max_tmp = used_after_gc / minimum_used_percentage; size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); maximum_desired_capacity = MAX2(maximum_desired_capacity, - MetaspaceSize); + (size_t)MetaspaceSize); if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr(" " " maximum_free_percentage: %6.2f" @@ -3197,7 +3197,7 @@ // Make the first class chunk bigger than a medium chunk so it's not put // on the medium chunk list. The next chunk will be small and progress // from there. This size calculated by -version. - _first_class_chunk_word_size = MIN2((size_t)MediumChunk*6, + _first_class_chunk_word_size = MIN2((uintx)MediumChunk*6, (CompressedClassSpaceSize/BytesPerWord)*2); _first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size); // Arbitrarily set the initial virtual space to a multiple --- old/src/share/vm/memory/threadLocalAllocBuffer.cpp 2014-06-18 08:47:21.094171244 +0200 +++ new/src/share/vm/memory/threadLocalAllocBuffer.cpp 2014-06-18 08:47:20.993172729 +0200 @@ -238,7 +238,7 @@ size_t init_sz; if (TLABSize > 0) { - init_sz = MIN2(TLABSize / HeapWordSize, max_size()); + init_sz = MIN2((size_t)(TLABSize / HeapWordSize), max_size()); } else if (global_stats() == NULL) { // Startup issue - main thread initialized before heap initialized. init_sz = min_size(); --- old/src/share/vm/oops/objArrayKlass.inline.hpp 2014-06-18 08:47:21.512165102 +0200 +++ new/src/share/vm/oops/objArrayKlass.inline.hpp 2014-06-18 08:47:21.374167130 +0200 @@ -48,7 +48,7 @@ const size_t beg_index = size_t(index); assert(beg_index < len || len == 0, "index too large"); - const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); + const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride); const size_t end_index = beg_index + stride; T* const base = (T*)a->base(); T* const beg = base + beg_index; @@ -82,7 +82,7 @@ const size_t beg_index = size_t(index); assert(beg_index < len || len == 0, "index too large"); - const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); + const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride); const size_t end_index = beg_index + stride; T* const base = (T*)a->base(); T* const beg = base + beg_index; --- old/src/share/vm/runtime/arguments.cpp 2014-06-18 08:47:21.904159341 +0200 +++ new/src/share/vm/runtime/arguments.cpp 2014-06-18 08:47:21.794160958 +0200 @@ -1292,7 +1292,7 @@ // NewSize was set on the command line and it is larger than // preferred_max_new_size. if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line - FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size)); + FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, (uintx)preferred_max_new_size)); } else { FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size); } @@ -1317,8 +1317,8 @@ // Unless explicitly requested otherwise, make young gen // at least min_new, and at most preferred_max_new_size. if (FLAG_IS_DEFAULT(NewSize)) { - FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new)); - FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize)); + FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, (uintx)min_new)); + FLAG_SET_ERGO(uintx, NewSize, MIN2((uintx)preferred_max_new_size, NewSize)); if (PrintGCDetails && Verbose) { // Too early to use gclog_or_tty tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); @@ -1328,7 +1328,7 @@ // so it's NewRatio x of NewSize. if (FLAG_IS_DEFAULT(OldSize)) { if (max_heap > NewSize) { - FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize)); + FLAG_SET_ERGO(uintx, OldSize, MIN2((NewRatio*NewSize), (uintx)(max_heap - NewSize))); if (PrintGCDetails && Verbose) { // Too early to use gclog_or_tty tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);