Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:57:21+00:00 2026-06-13T05:57:21+00:00

With VisualVM I am observing the following heap usage on a JBoss server: The

  • 0

With VisualVM I am observing the following heap usage on a JBoss server:

VisualVm Screenshot of Heap usage

The server is started with the following (relevant) JVM options:

-Xrs -Xms3072m -Xmx3072m -XX:MaxPermSize=512m -XX:+UseParallelOldGC -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

And we currently also have enabled GC logging:

-XX:+PrintGC -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:log\gc.log

Basically I am happy with the observed pattern, since it looks like we don’t have any memory leaks (the pattern repeats itself over days).

However I am wondering if there is room for optimization?

First of all, I don’t understand why the garbage collection already kicks in when the heap usage reaches about 2GB? It looks to me like it could kick in later since the heap would have 3GB available?

Further more I would be interested in tips regarding the observed heap usage pattern and the used JVM options:

  • Does the observed pattern allow me to draw conclusions about the used GC strategy (UseParallelOldGC)? Ist this strategy the right one, or should I try to use another one given the observed heap usage?

  • Can I optimize the GC process, so that the full heap size (3GB) is used?

  • Right now it looks like the full 3GB are never used, should I reduce the Xms/Xmx to 2.5GB?

  • Are there any obvious GC optimizations that I am missing? Like tuning -XX:NewSize or -XX:NewRatio?

  • Any other tips that come to mind?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:57:22+00:00Added an answer on June 13, 2026 at 5:57 am

    I’d say the GC behaviour in your screen-shot looks ‘normal’.

    You’d usually want major collections to trigger before the heap space gets too full or it would be very easy to encounter OutOfMemoryError’s, based on a number of scenarios.

    Also, are you aware that Java’s heap space is divided into distinct areas for new (eden), current (survivor) and old (tenured) objects?

    This answer provides some excellent information on the subject, so I won’t repeat it here:

    How is the java memory pool divided?

    Very basically, each area of the heap triggers its own collections. The eden space is normally collected often and ‘quickly’ the survivor and tenured spaces are usually larger and take longer to collect.

    Could you reduce your heap size based on the above graph?

    Yes. However, your current configuration allows your application some breathing room, if it’s ever likely to encounter busier periods or spikes in load.

    Can you optimize GC?

    Yes, but there are no magic settings. The first question is do you really need to? If your application is just a non-interactive ‘processor’, I really wouldn’t bother. If you have a genuine need for a low pause application, then there are some tweaks available. The trade off is generally that you’ll need more resources to achieve the same result.

    My experience is that low-pause JVM configurations have a very noticeable fall-off point when load increases. If your application is usually fairly idle, but you expect a ‘quick’ response when it is called, low pause may be appropriate. On a busier system, with peaks in traffic / load, you may prefer a more traditional approach.

    Summary

    In any case, don’t be tempted to make arbitrary changes to ‘improve’ your configuration. Be scientific and professional about your approach.

    If you don’t have production metrics available, consider using tools like Apache JMeter to build load test scenarios to simulate the typical live load on you application, increased load (by say, 10%, 20% or 50% etc.) and intermittent peak load.

    Use metrics for both the GC and the application, measuring at least:

    • Average throughput.
    • Peak throughput.
    • Average load (CPU and memory).
    • Peak load.
    • Application pause times (total and individual pauses).
    • Time spent performing collections.
    • Reliability (OOME’s etc.).

    Once you’re happy that you’ve recorded an accurate benchmark on the performance of you application with its current configuration, only then should you start making any changes.

    Obviously, record you configuration and its metrics. Document any changes and then perform the same benchmark tests. Then you’ll be able to see any performance gain (or loss) and any trade-off that may be applicable.

    Here’s the some further reading from Oracle on the subject to get you started:

    Java SE 6 Virtual Machine Garbage Collection Tuning

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to profile a local JBoss 7 server using the visualvm tool packaged
I consider running VisualVM against a production JVM to see what's going on there
I'm profiling my application using VisualVM and I see that the heap size increased
I am trying to use VisualVM to monitor my remote appliation. I started jstatd
How can I monitor an application's memory usage per thread? I tried VisualVM but
Is it possible that attaching a profiler to a JVM (let's say VisualVM) could
I'd like to use visualvm app through an ssh tunnel (to an EC2 machine)
I am trying VisualVM for detecting memory leak in java. I am using the
While using visualVM to detect memory leak, it allows us an Instance view as
I am trying to use VisualVM to profile a Java (Sun JDK 1.6) standalone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.