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

Memory Leak #430

Closed
matt-erhart opened this issue Sep 10, 2017 · 4 comments
Closed

Memory Leak #430

matt-erhart opened this issue Sep 10, 2017 · 4 comments

Comments

@matt-erhart
Copy link

 attributes: {
    someAttr: () => regl.buffer( array... ),
}

I just learned that this results in a context loss from a memory leak. I wanted to leave this here for future searchers, and understand what's happening. Why does creating the regl.buffer like the above cause a memory leak? Putting it outside the draw command works as expected.

@yoshuawuyts
Copy link

yoshuawuyts commented Sep 10, 2017 via email

@matt-erhart
Copy link
Author

Creating a new regl.buffer each frame sounds right.

Yea, it adds mbs to the ram per second crashes after 55-60 seconds and says the (regl) context was lost. Probably reaches some time/gb limit, and stops.

@jwerle
Copy link
Contributor

jwerle commented Sep 11, 2017

@matt-erhart yeah returning an already created instance or just assigning the value of that attribute to be the buffer should suffice. you can update or reinitialize the buffer later . I've noticed a lot of overhead when using dynamic attributes (functions) over dynamic buffers

@gregtatum
Copy link
Member

It appears to me you are creating WebGL buffers in a tight loop and they are not being de-allocated. There is nothing to garbage collect, as they are being added through the WebGL API, and not part of the garbage collector. This appears to be more of a user error, and nothing appears to be actionable from the side of the library, so i'm going to go ahead and close this.

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

4 participants