Memory consumption and memory leaks