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 in widget renderer and texture caches #2069
Comments
This introduce also a severe memory leak when selecting text in Lines 1464 to 1467 in 8fa5af4
And the entry's objects are generated dynamically: Lines 1358 to 1363 in 8fa5af4
if you keep selecting and deselecting text, you will see that the memory used will increase. |
Same memory leak issue has the widget.List: Lines 405 to 407 in 8fa5af4
Maybe other widgets like |
Yes, this is an issue that needs resolved. We have Probably a duplicate of #348 |
We might be able to utilize https://golang.org/pkg/runtime/#SetFinalizer for part of that cleanup (perhaps setting the |
The issue here isn't so much that the widgets are done but that some texture cached in the driver is unused. |
They are indeed all related. Not clear which are the true root cause, but various caches should be cleared once we are able to track what objects / caches are no longer needed. |
Hmm maybe we should walk over the object tree at fixed intervals and compare them with caches, if an object is in the cache but not in tree, then it should be removed from the cache. However, not sure how this would impact the performance, cause we would need to walk the object tree quite often. |
Yes, that is the balance to be found. Though we would get away with not-very-often I would think. |
Fixed on |
Describe the bug:
Fyne widgets use internally a renderer cache to improve performance, however when the widget goes out of the scope, Fyne does not have any way to free that memory from the cache.
fyne/internal/cache/widget.go
Line 9 in 8fa5af4
The same thing occurs with canvas primitives and the texture cache:
fyne/internal/painter/gl/gl_common.go
Line 17 in 8fa5af4
This memory leak occurs commonly when user replaces objects in containers:
This could be the root cause of #348.
This is also an extension from #735.
To Reproduce:
This memory can be seen in
fyne_demo
, when the tutorials contents are set:fyne/cmd/fyne_demo/main.go
Lines 111 to 112 in 8fa5af4
fyne_demo
.Device (this issue is platform independent):
develop
@ 8fa5af4The text was updated successfully, but these errors were encountered: