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

  • Home
  • SEARCH
  • 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 188547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:05:18+00:00 2026-05-11T16:05:18+00:00

Is there a way to set heap size from a running Java program?

  • 0

Is there a way to set heap size from a running Java program?

  • 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-11T16:05:18+00:00Added an answer on May 11, 2026 at 4:05 pm

    No.

    What you can do with an app that has very variable heap requirements is to set your max heap size very high with -Xmx and tune -XX:MaxHeapFreeRatio and -XX:MinHeapFreeRatio so that the app will not hang on to a lot of memory when the heap shrinks (it does that with default settings).

    But note that this may cause performance problems when the memory actually used by the app varies both strongly and quickly – in that case you’re better off having it hang on to all the memory rather than give it back to the OS only to claim it again a second later. You might also want to fiddle with the GC options to ensure that the GC doesn’t leave too much unclaimed objects lying around, which it tends to do when there’s a lot of room for the heap to grow, and which would defeat the goal of wanting the heap size to adjust to the app’s needs.

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

Sidebar

Ask A Question

Stats

  • Questions 169k
  • Answers 169k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer browser.link(:after?, browser.image(:src, /image/)).click Sources: http://wiki.openqa.org/display/WTR/How+and+What http://wiki.openqa.org/display/WTR/Ways+Available+To+Identify+HTML+Tag http://wiki.openqa.org/display/WTR/Methods+Supported+by+Element http://www.mail-archive.com/wtr-general%40rubyforge.org/msg08829.html http://zeljkofilipin.com/2007/05/25/watir-has-a-new-method-after/ May 12, 2026 at 2:00 pm
  • Editorial Team
    Editorial Team added an answer Declare thisbundle in your function and not in the global… May 12, 2026 at 2:00 pm
  • Editorial Team
    Editorial Team added an answer It failed to compile because of a missing native .dll… May 12, 2026 at 2:00 pm

Related Questions

I am given a task to convert a huge table to custom XML file.
I run a Java code with the following command: $ java -Xms4G -Xmx4G myjavacode
I'd like to store a set of objects in a min heap by defining
As we all know, the java -Xmx option is used to set the maximum

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.