How to deal with the Java OutOfMemoryError or a Memory Leak

Last days I was working in analyzing some reported OutOfMemoryError in a JVM application, that’s why I decided to share some information about how to deal with it. The first thing many people have in mind when they see an OutOfMemoryError is that we might have in front of a Memory Leak, a quick answer to that is that maybe yes but maybe not. So, let’s try to determine the...