You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using multiple PlaneBufferGeometry objects. I noticed when creating 10 + meshes based on this, with 255x255 segments, the memory usage can quickly jump to 100mb+.
The memory in use is mainly composed by the .array attribute in the various BufferAttributes. When running:
For all meshes, everything still renders fine (and I can freely rotate, etc.). Memory in use drops back to 10mb. I have no intention of altering the geometries after initializing. It feels like a hack though;
Is there a recommended way of freeing javascript memory after the attributes have been allocated in webgl?
Does my workaround have any downsides? Am I missing something important here?
I came across similar issues. see #9512 ... nice to see someone with the same issues, saved a lot of heap exhaustion and crashes for me,
Your solution works more by luck (the renderer defaults to Float32), and some of the mods iv'e made since I put in that PR (not accepted). The PR #9972 would remove the luck element.
The above PR puts the removal of the large arrays in a call back so there is certainty that the buffer has been uploaded. I can imagine situations where an object is out of visibility and not passed to the GPU when you expect it to be otherwise.
Description of the problem
I'm using multiple PlaneBufferGeometry objects. I noticed when creating 10 + meshes based on this, with 255x255 segments, the memory usage can quickly jump to 100mb+.
The memory in use is mainly composed by the .array attribute in the various BufferAttributes. When running:
For all meshes, everything still renders fine (and I can freely rotate, etc.). Memory in use drops back to 10mb. I have no intention of altering the geometries after initializing. It feels like a hack though;
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: