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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:53:37+00:00 2026-06-16T03:53:37+00:00

I have a java application form which i am accessing records from database,processing it

  • 0

I have a java application form which i am accessing records from database,processing it and again updaing the database.
I am doing this by converting my java application to JAR and executing it from command prompt.During testing there are only 20 records
per table in database.For that i am executing the jar as follows to avoid out of memory error,

java -jar -Xmx512m MyApp.jar

If database contains much record(50,000),how to increase the heap size while executing jar or How to increase the heap size dynamically based on needs while executing the jar.

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-16T03:53:38+00:00Added an answer on June 16, 2026 at 3:53 am

    The maximum is the maximum heap you would need ever not how much it will actually use. It’s the point at which you would rather than application crash than keep running. The JVM will dynamically manage the memory used up to this point.

    How to increase the heap size dynamically based on needs while executing the jar.

    So if you want the JVM to use 256 MB, but you want it to dynamically grow up to 30 GB you would set it like this

    java -ms256m -mx30g -jar MyApp.jar
    

    Even the minimum is not guaranteed to be used. The JVM will do minimal effort to keep the memory usage up to this level. A Hello World program will not use 256 MB of heap no matter what you set the minimum to.

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

Sidebar

Related Questions

I have a form on my Java application which basically is to provide the
I have a java swing application which has a form that I populate by
In Java web application (JSF), I have a Person form which has Add details
In my Java spring application I have a form with Region drop down. On
Sorry for my little knowledge of java-script.I have an application where sign-up form is
I have Java application which sends pointer to function (callback) to some native dll
I have a java application which needs to read and write files to HDFS.
I have a java-application using JDBC for database interaction. I want to do a
I have a taskBarIcon element extending Application Context from which my entire UI is
I have a web application (Java, Websphere, JSP) which allows co-workers to register visitors

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.