In fact, the first thing I do is to check whether or not it is actually a memory leak. Occasionally individuals simply continue increasing -Xmx until it seems an enchanted spell, however when your application is object leaking you will only be pushing off the crash. Such tools as VisualVM or YourKit can assist you in identifying the objects that are consuming a lot of memory. Subsequently, I tend to optimize collections and caches, occasionally all one needs to do is to clean up references.