CMS garbage collector - when does it run?
问题 I am confused about two parameters that may control when the CMS collector kicks in: MaxHeapFreeRatio (70% by default) CMSInitiatingOccupancyFraction (over 90% by default) What does each of those parameters mean, exactly? When does the collector start (the marking phase), and collect (the sweeping phase)? 回答1: CMSInitiatingOccupancyFraction decides when the CMS kicks in (in order for this option to be effective you must also set -XX:+UseCMSInitiatingOccupancyOnly ). MaxHeapFreeRatio is an