1

I have a following Error Message from my eclipse.

Exception in thread "th3" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Unknown Source)
    at java.util.Arrays.copyOf(Unknown Source)
    at java.util.ArrayList.ensureCapacity(Unknown Source)
    at java.util.ArrayList.add(Unknown Source)
    at Apeiron.FBM.Analysis.Clustering.Key.PatternClusterKey.Load(PatternClusterKey.java:260)
    at Apeiron.FBM.Analysis.UserBin.WaferUserDefineBin.CreatePatternClusterKey(WaferUserDefineBin.java:50)
    at Apeiron.FBM.Analysis.UserBin.UserDefineBin.Load(UserDefineBin.java:244)
    at Apeiron.FBM.Analysis.UserBin.WaferUserDefineBinDictionary.CreateUserDefineBin(WaferUserDefineBinDictionary.java:70)
    at Apeiron.FBM.Analysis.UserBin.UserDefineBinDictionary.Load(UserDefineBinDictionary.java:162)
    at Apeiron.MultiCore.OutputFileCreator.LoadDictionary(OutputFileCreator.java:357)
    at Apeiron.MultiCore.OutputFileCreator.run(OutputFileCreator.java:148)
    at java.lang.Thread.run(Unknown Source)

My Program of Apeiron is accomplished by four Threads & call a file that can be read with "org.w3c.dom.Document". That file becomes the object of WaferUserDefineBin.

So, I have done some experiments. The phenomena I figure out are following:
1. I think it is not about heap size. Maximum memory of my eclipse is 256M but My program use just 40M ~ 50M. and I have tried to expanse heap size to 512M from eclipse.ini file.

  1. It is problem of the file size that is changed WaferUserDefineBin. If I lessen size of the file, It doesn't happen Error.

  2. It is problem of Multi-Threading. It does good operation in single-thread even if Size of the file is big.

  3. Also, I use a Lock at region of reading the file but, Same Error occurs.

    I'm sorry for my poor English ability. Thanks a lot for your Help in advance.

1
  • Of course it's a heap-space problem - your first clue should be "java.lang.OutOfMemoryError: Java heap space" at the top of the stack trace. Commented Jan 11, 2013 at 5:24

1 Answer 1

3

You need to increase the memory (heap size), but for your program, not for Eclipse itself.

You can find these settings in the "Run Configurations". There is a tab "Arguments" with an area "VM arguments". Put your -Xm there.

Sign up to request clarification or add additional context in comments.

1 Comment

I sincerely thank you Thilo. I solve my problem for your answer. "In Run->Run Configuration find the Name of the class you have been running, select it, click the Arguments tab then add: -Xms512M -Xmx1524M to the VM Arguments section" But, I don't know difference between eclipse.ini and "Run Configurations". Actually, I mainly use C#.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.