java.lang.RuntimeException Java heap space error

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);

}

Could you post a link to the STL files?