92
views
views

OutOfMemoryError generally means that there's something wrong with your system or storing objects for too long, or processing too many data at a time. Sometimes, it's a sign of an issue that's beyond your control, like the use of a third-party library to cache strings, or the application server fails to clear up after deployments. In other cases, it's nothing to do with the objects that are in the heap.
ERROR _OUTOFMEMORY Message - Since the java.lang.OutOfMemoryError descends from the Throwable class, it can be caught and handled in application code. In some instances, particularly where the code lines which could be the cause of the OutOfMemoryError are identified in advance, it's recommended to take care of the error. If it's feasible to do this the best option is to remove the resource and then record the cause of the error, and then close the program with a smooth exit.