Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exhaustUpdate causes memory usage to increase rapidly #3

Open
SamiraAtMicrosoft opened this issue Aug 13, 2018 · 2 comments
Open

exhaustUpdate causes memory usage to increase rapidly #3

SamiraAtMicrosoft opened this issue Aug 13, 2018 · 2 comments

Comments

@SamiraAtMicrosoft
Copy link

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.

@stewdio
Copy link
Collaborator

stewdio commented Aug 13, 2018

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

@SamiraAtMicrosoft
Copy link
Author

SamiraAtMicrosoft commented Aug 15, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants