Memory settings influences a lot of garbage collection if it is too little. And allocation if it is too much. In the gradle report you should see percentage of the garbage collection and gradle team has recommendation about appropriate threshold for it. I'm not sure if there is measurements about allocation to detect 'a lot of memory' given. My algorithm was to start with small memory setting and increase it gradually to finally reach the enough level.