A method, system and computer program product for garbage collection
sensitive load balancing is disclosed. The method for memory tuning for
garbage collection and CPU utilization optimization can include
benchmarking an application across multiple different heap sizes to
accumulate garbage collection metrics and utilizing the garbage
collection metrics accumulated during benchmarking to compute both CPU
utilization and garbage collection time for each of a selection of
candidate heap sizes. One of the candidate heap sizes can be matched to a
desired CPU utilization and garbage collection time, and the matched one
of the candidate heap sizes can be applied to a host environment.