In T157968 we specified -Xms and -Xmx settings for the Zookeeper JVMs and we observed a positive impact to the GC behavior. This positive impact was due to the Xms value set equal to the Xmx one, forcing the minimum heap size allocated (if not specified it is the default, 256m) to max heap right from the start of the JVM. This also fixes the value of Heap memory committed to max heap, allowing the GC to be less conservative. More details documented in: https://wikitech.wikimedia.org/wiki/JVM_Tuning#Setting_max_and_min_heap_.28-Xmx_and_-Xms.29
I believe that specifying the Xmx settings equal to Xmx for most of the Hadoop JVMs (Yarn RM and NM, HDFS NN and DN) will have a positive impact.