Why memory-related issues can cause performance problems?
Memory-related issues can affect an application's execution speed and stability:
When Java Virtual Machine cannot allocate an object (because it is out
of memory, and no more memory can be freed by the garbage collector),
OutOfMemoryError is thrown, which can cause an application crash or further unstable operation.
An application that uses a lot of memory reduces available physical memory for itself and other programs, and
thus forces the operating system to swap memory pages to and from the disk more frequently. This leads to serious overall system performance degradation.
Java Virtual Machine spends more time to perform garbage collection when more objects exist and more temporary objects are created.