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

Rendering text memory is increasing #3413

Open
2 tasks done
ninki51 opened this issue Nov 19, 2022 · 3 comments
Open
2 tasks done

Rendering text memory is increasing #3413

ninki51 opened this issue Nov 19, 2022 · 3 comments
Labels
unverified A bug that has been reported but not verified

Comments

@ninki51
Copy link

ninki51 commented Nov 19, 2022

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Rendering text memory increases until the memory is full

How to reproduce

1 running

Screenshots

No response

Example code

a := app.New()
a.Settings().SetTheme(&myTheme{})
w := a.NewWindow("test window")
w.Resize(fyne.NewSize(640, 320))
loop = 0
numStr := binding.NewString()
numLabel = widget.NewLabelWithData(numStr)
w.SetContent(container.NewVBox(
		numLabel,
		widget.NewButton("start", func() {
			loop = 1
		}),
		widget.NewButton("stop", func() {
			loop = 0
		}),
))
cnt := 0
for i:=0;i<10;i++ {
      go func() {
                  if loop == 0 {
			time.Sleep(time.Millisecond * 1000)
			continue
		  }
                  numStr.Set(fmt.Sprintf("counter:%d", cnt))
                  mutex.Lock()
		  cnt++
                  mutex.Unlock()
                  time.Sleep(time.Millisecond * 10)
      }
}
w.ShowAndRun()

Fyne version

2

Go compiler version

1.19

Operating system

Windows

Operating system version

windows 10

Additional Information

go version 1.19

@ninki51 ninki51 added the unverified A bug that has been reported but not verified label Nov 19, 2022
@andydotxyz
Copy link
Member

I think this is a duplicate of #2969, though the example code is helpful.
The texture cache is perhaps too long in timing out - after 5 minutes (IIRC) it should start freeing up this memory, but I guess your demo crashes before that?

@ninki51
Copy link
Author

ninki51 commented Nov 20, 2022

I think this is a duplicate of #2969, though the example code is helpful. The texture cache is perhaps too long in timing out - after 5 minutes (IIRC) it should start freeing up this memory, but I guess your demo crashes before that?

The program will eventually crash
How to free this memory?

@andydotxyz
Copy link
Member

It should be freed automatically - no developer action to be taken.
The issue does need to be resolved internally, but I do think it's the same root cause as #2969.
Lots of new text is either not hitting the cache, or it is not invalidating it after a short period of time...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

2 participants