Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to set the heap size to the RAM size inside the java program

Posted on 2003-03-06
6
Medium Priority
?
168 Views
Last Modified: 2010-03-31
i want set the heap size to RAM size in the program,
as i can set it through command line arguments like
java -mx256m some file
0
Comment
Question by:Virupaksha
  • 3
5 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 400 total points
ID: 8078968
 AFAIK you can't do it dynamically. But I am listening :-)
0
 
LVL 2

Expert Comment

by:karlika
ID: 8082389
No can do.
the max heap size is an initialisation parameter for the JVM.

However you may write some wrapper program (I would recommend C for this) which starts a new JVM with the desired heap size.

This is for most applications simply overkill. For other timecritical ones simply not acceptable.

But I'm also listening for other workarounds ;)
0
 
LVL 35

Expert Comment

by:girionis
ID: 8082782
 Well yes, but you can't change the heap size dynamically for the JVM instance you are currently using.
0
 

Expert Comment

by:CleanupPing
ID: 9058889
Virupaksha:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9686880
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to girionis

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn different types of Android Layout and some basics of an Android App.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question