java.lang.OutOfMemoryError problem

X

Xiaopeng Xiong

Hi all,

I am not very familiar with java. I am running a java appliation under
windows XP. I got an error message "java.lang.OutOfMemoryError", could you
tell me how to solve or at least ease this problem? The OS is on windows XP.
Thanks a lot.



Regards,
Xiaopeng Xiong
 
S

Steve W. Jackson

Xiaopeng Xiong said:
:Now I am wondering "-mx256m" would help or not......
:
:

It won't hurt, though it may not solve the entire problem.

You'll probably want to do some reading on Java's memory management. It
uses a "closed heap", as I call it. When you start up, the default is,
if memory serves, a 64 MB maximum heap size. This holds all Class
objects that are loaded by the JVM, as well as objects that are
instances of classes. And Java's garbage collection is a complete topic
unto itself. The bottom line is that the JVM tries several tricks to
get enough space in its heap when you want to allocate memory (like
creating objects via the new operator), and when it tries all its tricks
and still can't get enough memory you'll get this error. The parameter
you've found specifies a larger maximum heap. And that's why I say it
may not fix your problem, but may simply delay it until you've consumed
more memory -- depending on what you're doing.

= 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,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top