?
Solved

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

Posted on 2003-03-06
6
Medium Priority
?
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

770 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