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 6211795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:24:01+00:00 2026-05-24T06:24:01+00:00

Can anybody explain the side effects for increasing the maxpermsize and max heap size?

  • 0

Can anybody explain the side effects for increasing the maxpermsize and max heap size?

I know that sometimes, we increase -Xmx when we run into the outofmemory issue. But I am just wondering if there is any side effect that I need to keep in mind when we increase the -Xmx. And how does increasing maxpermsize affect the runtime?

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-05-24T06:24:03+00:00Added an answer on May 24, 2026 at 6:24 am

    Short answer

    Doubling java heap size, doubles the waiting time for Garbage Collection pauses, that with current JVM technologies become of multiple seconds when the heap is in the Gb order. It seems that the newly released Java 7 is going to change that.

    Long answer

    The MaxPermSize is the maximum size for the permanent generation heap, a heap that holds the byte code of classes and is kept separated from the object heap containing the actual instances. One thing to keep in mind in case of web applications, is that in each hot re-deployment this memory usage is going to increase with multiple copies of the same classes. Unless -XX:+CMSClassUnloadingEnabled is specified.

    Max Heap Size (-Xmx) and MaxPermSize have to be set taking into consideration how much memory is needed by the application classes and instances, the total memory of the server and the memory needed by other applications.

    Another important point is that expanding the memory from the Min Heap Size (-Xms) is a costly operation. Especially in case of financial applications this could mean delays. With similar real-time requirements, it could be a good idea to set -Xms and -Xmx to the same value.

    The following talk may be of interest http://www.infoq.com/presentations/Java-without-the-GC-Pauses

    From the talk you can evince that the side effect of increasing the heap more than a certain limit 2Gb, 10Gb, 100Gb, means longer pause time for Garbage Collection that could stop everything for seconds or a minute in case of very large heaps.

    For that reason with current JVM technology, you want to set the heap large enough to run your application, but not too large. A way to find the right size, could be set it to the largest possible value, then cut in half and keeping on cutting in half until you find problems, when you do, double the last found value and keep it as the chosen heap size for production.

    This advice of course applies for large heaps, in the Gb order, if your application runs fine with 256Mb of memory, I would just keep that value without further investigation.

    And finally for reference here are some example settings:

    -Xms512m -Xmx512m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to know if anybody can explain me the following piece of Javascript
Can anybody explain me this piece of code? /* Pad to size of `struct
Can anybody explain what's wrong? I have row[i] that is boxed decimal and when
can anybody explain what are these packages that have extension (.a) that we may
can anybody explain me the below code for trigger?Please note that the above code
Can anybody explain exactly how a web beacon works? I know they're generally used
can anybody explain this why its happening int i=0; i=i++; i=i++; i=i++; System.out.println(i); it
Can anybody explain the difference between cerr cout and clog and why does different
Can anybody explain (or suggest a site or paper) the exact difference between triggers,
Can anybody explain me what a dependency property is in WPF and what is

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.