java.lang.OutOfMemoryError: Java heap space

View: New views
2 Messages — Rating Filter:   Alert me  

java.lang.OutOfMemoryError: Java heap space

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All,

           I want to draw 4000 triangles. By using following Geometry array i have drawn all the triangles.

      TriangleArray landGeom = new TriangleArray(args.length, GeometryArray.COORDINATES|TriangleArray.COLOR_3);


But when i run sometimes iam getting a following exception


xception in thread "main" java.lang.OutOfMemoryError: Java heap space
       at javax.media.j3d.GeometryArrayRetained.createGeometryArrayData(Geo
ArrayRetained.java:1612)
       at javax.media.j3d.GeometryArray.<init>(GeometryArray.java:854)
       at javax.media.j3d.GeometryArray.<init>(GeometryArray.java:592)
       at javax.media.j3d.GeometryArray.<init>(GeometryArray.java:447)
       at javax.media.j3d.TriangleArray.<init>(TriangleArray.java:45)
       at Wrap3D.Triangles(Viewer.java:279)
       at Wrap3D.Tetrahedron(Viewer.java:178)
       at Wrap3D.createSceneGraph(Viewer.java:735)


How can i avoid this exception. Please help me

Thanking you.
[Message sent by forum member 'prasad32' (prasad32)]

http://forums.java.net/jive/thread.jspa?messageID=281144

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: java.lang.OutOfMemoryError: Java heap space

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Out of Memory Exceptions are solved quickly by using  -Xmx jvm option.
Example

java -Xmx256m MyApplication

But 4k triangles is a very simple geometry and should not raise an OEM exception for default -Xmx value of 64m, unless it is medium size swing application.
[Message sent by forum member 'aces' (aces)]

http://forums.java.net/jive/thread.jspa?messageID=282757

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...

LightInTheBox - Buy quality products at wholesale price