java.lang.OutOfMemoryError: Java heap space

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


25 points

I am running a java application that I wrote and I am getting this error:

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.(String.java:216)
at java.lang.StringBuilder.toString(StringBuilder.jav a:430)
at net.sourceforge.retriever.fetcher.HTTPFetcher.getI nnerURLs(Unknown Source)
at net.sourceforge.retriever.fetcher.Fetcher.fetch(Un known Source)
at net.sourceforge.retriever.URLParser.run(Unknown Source)
at net.sourceforge.retriever.ThreadPool$RunnableHandl er.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

Any help is appreciated.



-6 points

It means that the JVM has run out of all the memory that has been allocated to it. You can change the amount of memory allocated for use by your JVM using the -Xms and -Xmx command line parameters.

For example, the following says run your myApp in a JVM and allocate a minimum of 5 Megabytes and a maximum of 15 Megabytes off of the heap in order to do so.

java -Xms5m -Xmx15m myApp

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.