Computer memory is finite: it must be managed so that items no longer in use are removed to make space for new items. In older languages, it was the programmer’s responsibility to deallocate memory. Newer languages use garbage collection (GC). In Java, this is a process that runs in the background within the JVM. https://medium.com/@jill.thornhill/java-garbage-collection-fundamentals-how-it-works-and-why-it-matters-bb11b3c6480b