OutOfMemoryError

A

Allan Bruce

I am hitting a java.lang.OutofMemoryError exception, but my program only
seems to be using about 75MB of memory. My machine has 2GB of memory so
theres something not right.
Can anybody tell me how to resolve this? In case it matters, I am using
NetBeans IDE.
Thanks
Allan
 
R

Raffa Edwards

The following switches will set the minimum and maximum memory Java can
utilize: -Xms512m -Xmx512m
(Only the maximum is required.)

--Raffa
 
C

Chris Smith

Raffa said:
The following switches will set the minimum and maximum memory Java can
utilize: -Xms512m -Xmx512m
(Only the maximum is required.)

To be clear, neither is "required" per se. I suspect you mean only the
maximum is needed to solve this problem.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
S

Steve Horsley

Chris said:
To be clear, neither is "required" per se. I suspect you mean only the
maximum is needed to solve this problem.

Also, to be clear, these are command line arguments to the java VM. e.g.
java -Xmx512m MyClass
java -Xmx512m -jar MyJar.jar

The default max heap size is 64M, so allowing for the VM and other
overheads, running out at 70M sounds about right.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top