comparison src/share/vm/gc_implementation/g1/heapRegionManager.cpp @ 20382:b1266b08b994

8056043: Heap does not shrink within the heap after JDK-8038423 Summary: Enable shrinking within the heap by removing some code added for JDK-8054818. Enable the test case that checks that again too. Reviewed-by: jwilhelm, jmasa
author tschatzl
date Wed, 03 Sep 2014 09:24:07 +0200
parents a8ea2f110d87
children d35872270666
comparison
equal deleted inserted replaced
20381:09e9e5240710 20382:b1266b08b994
349 uint idx_last_found = 0; 349 uint idx_last_found = 0;
350 uint num_last_found = 0; 350 uint num_last_found = 0;
351 351
352 while ((removed < num_regions_to_remove) && 352 while ((removed < num_regions_to_remove) &&
353 (num_last_found = find_empty_from_idx_reverse(cur, &idx_last_found)) > 0) { 353 (num_last_found = find_empty_from_idx_reverse(cur, &idx_last_found)) > 0) {
354 // Only allow uncommit from the end of the heap.
355 if ((idx_last_found + num_last_found) != _allocated_heapregions_length) {
356 return 0;
357 }
358 uint to_remove = MIN2(num_regions_to_remove - removed, num_last_found); 354 uint to_remove = MIN2(num_regions_to_remove - removed, num_last_found);
359 355
360 uncommit_regions(idx_last_found + num_last_found - to_remove, to_remove); 356 uncommit_regions(idx_last_found + num_last_found - to_remove, to_remove);
361 357
362 cur -= num_last_found; 358 cur -= num_last_found;