https://devhubby.com/thread/how-to-handle-out-of-memory-error-in-java