for me problem was full survivor spaces. As CMS isn't compactional, garbage was promoted directly to old gen. this could be very expensive with such large heap. It's necessary to increase Survivor spaces and MaxTenuringThreshold to avoid promotion as much as possible.