Over a million developers have joined DZone.

Most popular memory configurations

DZone's Guide to

Most popular memory configurations

Free Resource

SignalFx is the only real-time cloud monitoring platform for infrastructure, microservices, and applications. The platform collects metrics and traces across every component in your cloud environment, replacing traditional point tools with a single integrated solution that works across the stack.

This article comes from Vladimir Šor at the Plumbr Blog.

Java memory usageThis post is the third in the series where we publish statistical data about the Java installations. The dataset used originates from the free Plumbr installations out there totalling 1,024 different environments we have collected during the past six months.

First post in the series analyzed the foundation – on what OS the JVM is run, whether it is a 32 or 64-bit infrastructure and what JVM vendor and version were used. Second post focused on the different application servers used. The one you are reading now sheds some light upon the heap sizes used by Java applications.

For the task at hand we dug into the 1,024 environments we had gathered statistics from. 662 out of those had overridden the default maximum heap size by setting the -Xmx parameter. Also, 414 had felt that the permanent generation is not properly sized and had specified -XX:MaxPermSize by themselves.

First lets take a look at the heap sizes. The data when sampled and summarized took the following form:

Java memory used

When you are interpreting the data then – the nine in the 64MB section has to be read that “There were nine environments in the sample with 32MB < maximum allowed heap size <= 64MB.”

But what makes this graph interesting are the outliers. Or, more specifically, the environments with either too large or too small heaps as the results do not actually correspond well to our initial assumptions that 75% of the environments are using between 0.5 and 4GB of heap size. Our guess was close near the reality – 70% of the environments are indeed in this range. But the rest was surprising. Only 4% ran on bigger heap sizes with the biggest heap in our sample being set to 42G.

And the surprise lies within the remaining 26% of the JVMs running with less than 512MB heaps. As a matter of fact, 95% of them are running on 256MB and less. Our initial guess was that those have to be the non – Java EE applications. But the results are not verifying the guess – instead of -client switches and libraries indicating desktop applications we faced a mixture of everything. Even with some Weblogic instances running with 256MB. If you can hint us how are you able to run your Java EE apps on such small heaps, we are all eager to listen.

Second data set in our hands was the permgen. We summarized the 414 environments containing this information:

Java maximum permgen

Again, when interpreting the data looking at the eight samples in 2,048MB column – we had eight environments running with -XX:MaxPermSize larger than 1,024MB and smaller than or equal to 2,048MB.

Some surprises in this diagram as well. First – why do 160 people think that exactly256MB is the best possible size for the permgen? This constitutes roughly 40% of the environments. And those two who think 258MB is better – are you just bad at calculating the powers of two or have you done some real fine-tuning? And the extremes are also interesting – if you can describe me the applications which are ok with less than a MB of permgen or which would require 6GB of it, I would again be all ears.

While interpreting the data we also got some confirmation to our assumptions that people are solving java.lang.OutOfMemoryError: PermGen space errors via tossing more RAM towards the problem. It just cannot be that 25% of the environments need 512MB or more in the permgen for anything else but covering up permgen leaks.

If you managed to get this far, then you are most likely interested to hear about our forthcoming posts. Stay tuned by subscribing to our Twitter feed.

SignalFx is built on a massively scalable streaming architecture that applies advanced predictive analytics for real-time problem detection. With its NoSample™ distributed tracing capabilities, SignalFx reliably monitors all transactions across microservices, accurately identifying all anomalies. And through data-science-powered directed troubleshooting SignalFx guides the operator to find the root cause of issues in seconds.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}