more logic for deciding how much memory to give to kafka