What can cause OutOfMemoryError? Who to fix OutOfMemoryError?

What can cause OutOfMemoryError? Who to fix OutOfMemoryError?

java.lang.OutOfMemoryError error is thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.

If Java Virtual Machine stacks can be dynamically expanded, and expansion is attempted but insufficient memory can be made available to effect the expansion, or if insufficient memory can be made available to create the initial Java Virtual Machine stack for a new thread, the Java Virtual Machine throws an OutOfMemoryError.

Allow the JVM to use more memory using the -Xmx VM argument.

Improve/Fix the application so that it uses less memory.


Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)