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 #288

Open
SergeevPavel opened this issue Jun 3, 2019 · 4 comments
Open

Memory leak #288

SergeevPavel opened this issue Jun 3, 2019 · 4 comments

Comments

@SergeevPavel
Copy link

Hi, thank for your great work.
I doing some experiments on using webrender as a renderer for our ui framework and have faced with couple of problems.

I have simple example, that runs on mac os with metal backend. On every frame it sends display list with two rectangles. The problem with this is constant grow of used memory, according to profile on every frame render_impl allocates memory that will never be freed.

Second problem is about jni and shader recompilation. When I do same thing like in first example but throw jni most calls of submit_to_gpu return false (particularly error is OutOfDate, but according to this comment I'm not sure, that it's relevant) which leads to swapchain recreation and shader recompilation. Shader recompilation took time and also lead to huge memory leak.

I use macos 10.14.5 with Intel Iris Pro 1536 MB
I will be very grateful if you give me some thoughts about this examples

@zakorgy
Copy link

zakorgy commented Jun 4, 2019

@SergeevPavel thanks for the bug report. I am glad to see, that our work is used in a project.
For the first problem: I will look into the issue.
For the second part. Unfortunately I'm not really familiar with jni, and if you want to know more about that comment, maybe @kvark or @omni-viral could give you a proper explanation about that. For the shader recompilation part, if gfx-backend-metal will have a pipeline cache API like Vulkan it will be faster, the second part bothers me because I thought we are destroying the programs properly. I will try to look in that too.

@kvark
Copy link

kvark commented Jun 4, 2019

I don't understand that part about jni. Please describe in more detail.

@SergeevPavel
Copy link
Author

I'm working on lib that wrap webrender into jni interface. When I trying to run event loop on jvm thread it leads to constant errors from gfx-metal inside of render_impl. I don't understand how it connected, but I suppose it maybe explained throw some conflict of own jvm graphics code and gfx-metal. If it will be helpful I will try to reduce example from my lib and attach it here.

Second thing is that every swapchain_recreation consume bunch of memory, that leads to total used memory grow. I'm no sure but for me it also looks like mem leak.

@kvark
Copy link

kvark commented Jun 4, 2019

Thank you for the info @SergeevPavel !
For memory leaks, we are aware that IOSurface objects get lost somehow on resize, and are looking into it.

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

No branches or pull requests

3 participants