When the application’s memory is under-allocated, it will result in the following side-effects:
a. Transactions response time will degrade
Tips, Expertise, Articles and Advice from the Pro's for Your Website or Blog to Succeed
When the application’s memory is under-allocated, it will result in the following side-effects:
a. Transactions response time will degrade
In the series of chaos engineering articles, we have been learning to simulate various performance problems. In this post, let’s discuss how to simulate thread leaks. ‘java.lang.OutOfMemoryError: unable to create new native thread’ will be thrown when more threads are created than the memory capacity of the device. When this error is thrown, it will disrupt the application’s availability.
Here is a sample program from the open source BuggyApp application, which keeps creating an infinite number of threads.
Eclipse MAT is a powerful tool to analyze heap dumps. It comes in handy when debugging OutOfMemoryError. Eclipse MAT reports two types of object size: 1) Shallow Heap 2) Retained Heap. This video explains the difference between them and how they are calculated. Watch this video to learn more!
At the time (March 2020) of writing this article, there are 600+ arguments that you can pass to JVM just around garbage collection and memory. If you include other aspects, the number of JVM arguments will easily cross 1000+. It’s way too many arguments for anyone to digest and comprehend. In this article, we will highlight seven important JVM arguments that you may find useful.
-Xmx
is probably the most important JVM argument. -Xmx
defines the maximum amount of heap size you are allocating to your application. (To learn about different memory regions in a JVM, you may watch this short video clip). You can define your application’s heap size like this: