Memory leak is a scenario that occurs when objects are no longer being used by the application,
but the Garbage Collector is unable to remove them from working memory – because they’re still being referenced.
As a result, the application consumes more and more resources – which eventually leads to OutOfMemoryError.
Soft leaks: it may be possible that any objects are not being used for years but any third party API or
any other thing is there for keeping it live.. these kind of objects should be garbaged but they are
not because they are somehow referenced from stack.⭐️
If we analyze the Heap memory during this program execution, then we'll see that between debug points 1 and 2, the heap memory increased as expected.
But when we leave the populateList() method at the debug point 3, the heap memory isn't yet garbage collected,