Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
448 views
in Technique[技术] by (71.8m points)

out of memory - Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

I have written a code and I run it a lot but suddenly I got an OutOfMemoryError:

  Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at javax.media.j3d.BoundingBox.<init>(BoundingBox.java:86)
        at javax.media.j3d.NodeRetained.<init>(NodeRetained.java:198)
        at javax.media.j3d.LeafRetained.<init>(LeafRetained.java:40)
        at javax.media.j3d.LightRetained.<init>(LightRetained.java:44)
        at javax.media.j3d.DirectionalLightRetained.<init>(DirectionalLightRetained.java:50)
        at javax.media.j3d.DirectionalLight.createRetained(DirectionalLight.java:116)
        at javax.media.j3d.SceneGraphObject.<init>(SceneGraphObject.java:119)
        at javax.media.j3d.Node.<init>(Node.java:178)
        at javax.media.j3d.Leaf.<init>(Leaf.java:50)
        at javax.media.j3d.Light.<init>(Light.java:270)
        at javax.media.j3d.DirectionalLight.<init>(DirectionalLight.java:87)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Well, it's fairly self-explanatory: you've run out of memory.

You may want to try starting it with more memory, using the -Xmx flag, e.g.

java -Xmx2048m [whatever you'd have written before]

This will use up to 2 gigs of memory.

See the non-standard options list for more details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...