# java.lang.RuntimeException Java heap space error

**URL:** https://discourse.processing.org/t/java-lang-runtimeexception-java-heap-space-error/25351
**Category:** Libraries
**Created:** [November 11, 2020, 6:55pm UTC](https://discourse.processing.org/t/java-lang-runtimeexception-java-heap-space-error/25351 "2020-11-11T18:55:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ahmed](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ahmed](https://discourse.processing.org/u/ahmed)
#### Post date: [November 11, 2020, 6:55pm UTC](https://discourse.processing.org/t/java-lang-runtimeexception-java-heap-space-error/25351/1 "2020-11-11T18:55:44Z")

</div>

I am trying to import STL CAD file in processing but getting an error java.lang.outofmemoryerror java heap space.

how to solve this issue ? i have increased my memory in Preferences tab to 10GB but issue still persist. My CAD file size is big its 20MB. I have also used the loadshape() function to import .obj file of the same model but not satisfied with the result. As STL is the required format on which i am working. Can any body help ?

operting system windows 10, processing version 3.0

Thanks

following the example code i am using.

import toxi.geom.\*;

import toxi.geom.mesh.\*;

import toxi.processing.\*;

TriangleMesh mesh;

ToxiclibsSupport gfx;

void setup() {

size(600,600,P3D);

mesh=(TriangleMesh)new STLReader().loadBinary(sketchPath(“part1.stl”),STLReader.TRIANGLEMESH);

//mesh=(TriangleMesh)new STLReader().loadBinary(sketchPath(“part1.stl”),STLReader.TRIANGLEMESH).flipYAxis();

gfx=new ToxiclibsSupport(this);

}

void draw() {

background(51);

lights();

translate(width/2,height/2,0);

rotateX(mouseY\*0.01);

rotateY(mouseX\*0.01);

gfx.origin(new Vec3D(),200);

noStroke();

gfx.mesh(mesh,false,10);

}

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [November 14, 2020, 8:59am UTC](https://discourse.processing.org/t/java-lang-runtimeexception-java-heap-space-error/25351/2 "2020-11-14T08:59:20Z")

</div>

Could you post a link to the STL files?
