CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.72k stars 308 forks source link

JavaScript heap out of memory #285

Open kaigalmane opened 1 year ago

kaigalmane commented 1 year ago

I am trying to transform an 8GB OBJ file to GLTF. Below is the command used.

obj2gltf -i outputobj.obj -o building.gltf

Memory utilization goes up to 10GB in Task manager and throughs the below error. Added NODE_OPTIONS=--max-old-space-size=8192 in Environment Variables but no luck.

image

lilleyse commented 1 year ago

Hi @kaigalmane thanks for the report. Are you able to share the model?

kaigalmane commented 1 year ago

Unfortunately no since it's a client asset. We tried the commands below which seem to solve the memory issue. But didn't work.

image

image

lilleyse commented 1 year ago

@kaigalmane that's interesting... I assume that happens in the JSON stringify step. It's unusual for the JSON portion to get that large. Does the obj have a lot of object or group names?

One other thing to try is saving as a .glb (-i outputobj.obj -o building.glb -s) though I would expect it to hit the same error.