exhaustUpdate causes memory usage to increase rapidly
Looking at the Memory usage in Task Manager (under the Performance tab in Windows 10) I observed that the committed memory increases rapidly when playing the game.
The issue is not present if I remove the lines of code that update geometry.vertices inside player.js's exhaustUpdate function.
I observed this on both Chrome and Edge.
Good find! I don’t have time to investigate further at the moment; do you think it’s repairable? (I’d rather fix the issue or find a more efficient means of updating the exhaust trail rather than disabling it altogether.)
I think this can be answered once the root cause is discovered. I did some experimentation by modifying exhaustUpdate to simply:
function exhaustUpdate( side ){
const
arm = player.arms[ side ],
engine = arm.engine,
enginePositionNow = engine.localToWorld( new THREE.Vector3() ).sub( M.three.world.position ),
exhaust = arm.exhaust,
geometry = exhaust.geometry
geometry.elementsNeedUpdate = true
}
And the memory usage continues to climb. However, removing the call to elementsNeedUpdate results in stable memory usage.
Perhaps there is an underlying issue with THREE.CylinderGeometry or how it is meant to be used?