Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class with heap memory

Status
Not open for further replies.

qbasicking

Programmer
Aug 19, 2001
628
US
I have been unable to find anything about heap memory in my JAVA book and I need to be able to create a class with the non-standard option of having 256MB of heap memory. Any help would be appreciated.
 
That's nothing you can do in the class itself, since the heap memory is allocated in the JVM. If you start the program with the option -Xmx256mb, you'll be fine. Like this:

Code:
java -Xmx256m -classpath . some.package.MyClass

Have a read in your favourite command line at "java -?" and "java -X".

haslo@haslo.ch - www.haslo.ch​
 
I would initialise the heap also with :

Code:
java -Xms256m -Xmx256m -classpath . some.package.MyClass

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top