RFR (S) 8223762: Shenandoah: overflows in calculations involving heap capacity

Aleksey Shipilev shade at redhat.com
Mon May 13 10:30:41 UTC 2019


Bug:
  https://bugs.openjdk.java.net/browse/JDK-8223762

Heap capacity is in size_t. Which means expressions involving it are subject to overflow if done
without care. Consider the x86_32 case with max_capacity = 1G and ShenandoahMinFreeThreshold >= 5.
this overflows this expression here on 32-bit platforms:
   size_t min_threshold = ShenandoahMinFreeThreshold * heap->max_capacity() / 100;

This readily happens on x86_32 and wreck up heuristics calculations.

Fix:
  http://cr.openjdk.java.net/~shade/8223762/webrev.01/

Testing: hotspot_gc_shenandoah (x86_64, x86_32), plus ad-hoc x86_32 tests

-- 
Thanks,
-Aleksey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20190513/1254c61e/signature.asc>


More information about the hotspot-gc-dev mailing list