Memory management in Java apps is not as simple as suggested in this scenario. If the user allocates a load of resources in a Java app then releases them, the user can’t expect an immediate drop in the memory footprint of the app running on their machine. This is not how memory is controlled in a managed environment like a Java Virtual Machine (JVM). The memory is released when the JVM decides it is time to perform a garbage collection. We have no control over this, the JVM does this in the background when it decides the time is right and cannot predict when it is going to happen. Forcing a garbage collection in code (which is exceedingly bad practice) does not even free up memory.