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

goroutines demo memory leak #31

Open
Kuangcp opened this issue Feb 1, 2021 · 0 comments
Open

goroutines demo memory leak #31

Kuangcp opened this issue Feb 1, 2021 · 0 comments

Comments

@Kuangcp
Copy link

Kuangcp commented Feb 1, 2021

just shortened sleep time

go func() {
for {
time.Sleep(time.Millisecond*5)
s := fmt.Sprintf("Set a label %d time(s)!", nSets)
_, err := glib.IdleAdd(LabelSetTextIdle, topLabel, s)
if err != nil {
log.Fatal("IdleAdd() failed:", err)
}
nSets++
s = fmt.Sprintf("Set a label %d time(s)!", nSets)
_, err = glib.IdleAdd(bottomLabel.SetText, s)
if err != nil {
log.Fatal("IdleAdd() failed:", err)
}
nSets++
if nSets > 1000000{
nSets = 0
}
}
}()

10 minutes later

image

15 minutes later
image

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

1 participant