--- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-06-13 03:58:10.000000000 -0400 +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp 2014-06-13 03:58:10.000000000 -0400 @@ -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; } @@ -4609,7 +4609,7 @@ // The > 0 check is to deal with the prev and next live bytes which // could be 0. if (*hum_bytes > 0) { - bytes = MIN2(HeapRegion::GrainBytes, *hum_bytes); + bytes = MIN2(HeapRegion::GrainBytes, (size_t)*hum_bytes); *hum_bytes -= bytes; } return bytes;