In which region intern strings are stored?

intern() is an interesting function in java.lang.String object. intern() function eliminates duplicate string objects from the application and has potential to reduce overall memory consumption of your application. To understand how string intern() function works you may refer to this interesting blog. Intern strings are stored in a string pool in the JVM memory. JVM Memory has following regions:

Continue reading “In which region intern strings are stored?”

Java Hashtable, HashMap, ConcurrentHashMap – Performance impact

There are a good number of articles that articulate functional differences between HashMap, HashTable and ConcurrentHashMap. This post compares the performance behavior of these data structures through practical examples. If you don’t have patience to read the entire post, here is bottom line: When you confront with the decision of whether to use HashMap or HashTable or ConcurrentHashMap, you can consider using ConcurrentHashMap since it’s thread-safe implementation, without compromise in performance.

Continue reading “Java Hashtable, HashMap, ConcurrentHashMap – Performance impact”

Benefits of setting initial and maximum memory size to the same value

When we launch applications, we specify the initial memory size and maximum memory size. For the applications that run on JVM (Java Virtual Machine), initial and maximum memory size is specified through ‘-Xms’ and ‘-Xmx’ arguments. If Java applications are running on containers, it’s specified through ‘-XX: InitialRAMPercentage’ and ‘-XX: MaxRAMPercentage’ arguments. Most enterprises set the initial memory size to a lower value than the maximum memory size. As opposed to this commonly accepted practice, setting the initial memory size the same as the maximum memory size has certain ‘cool’ advantages. Let’s discuss them in this post.

Continue reading “Benefits of setting initial and maximum memory size to the same value”

Is today’s microservice more bloated than yesterday’s monolith?

I am slightly hesitant to write this post, as it might attract some criticism. Nevertheless, I told myself there is nothing wrong with sharing my point of view (even though it might not be well accepted). I would like to share my personal experience regarding yesterday’s Monolithic and today’s Microservice architecture in this post.

Continue reading “Is today’s microservice more bloated than yesterday’s monolith?”

Java threads – may not be memory effecient?

Java applications tend to contain hundreds (sometimes thousands) of threads. The majority of these threads are in WAITING, TIMED_WAITING (i.e., dormant) state, while only a small portion of the threads are actively executing lines of code. So, we were curious to know whether dormant threads consume less memory than active threads.

To figure out an answer to this question, we conducted a small study. Our findings were interesting, thus sharing with you.

Continue reading “Java threads – may not be memory effecient?”

Blog at

Up ↑