PCDLoader: Memory error with arraybuffer

Description of the problem

I’m getting the following error:
"[Exception... "Out of Memory" nsresult: "0x8007000e (NS_ERROR_OUT_OF_MEMORY)" location: "JS frame :: webpack-internal:///./src/assets/js/Vue/Live/ThreeJs/Init.js :: updateFigure :: line 98" data: no]"

So how do I get that memory error?
Well, I’m trying to recreate a live image feed.
What I do is I send a request to a server to get a raw PCD file in text format.
When I receive an answer I replace it with the current mesh that is loaded.
But after 1056 requests I got that memory error.
The ArrayBuffer is getting bigger and bigger??
The size of the data string is around 16MB each.

The code where he gets the error:

async function updateFigure(liveFeed) {
        PCDData = liveFeed;
        let PCD = scene.getObjectByName('liveFeed');
        let loader = new Three.PCDLoader();
        let enc = new TextEncoder();
        let data = enc.encode(PCDData);
        let mesh = loader.parse(data, 'liveFeed');
        PCD.geometry = mesh.geometry;

Arraybuffer is becoming 12GB.


Three.js version
  • Dev
  • r103
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “PCDLoader: Memory error with arraybuffer

  1. Thank you very much, like you can see the overall RAM usage is now around 140MB instead of increasing everytime


Comments are closed.