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

does for rang time.Tick() cause memory leak? #39092

Closed
Rain-31 opened this issue May 15, 2020 · 3 comments
Closed

does for rang time.Tick() cause memory leak? #39092

Rain-31 opened this issue May 15, 2020 · 3 comments

Comments

@Rain-31
Copy link

Rain-31 commented May 15, 2020

I see some pages ues time.Tick() like:

for range time.Tick(time.Second) {
}

will this cause memory leak?

@go101
Copy link

go101 commented May 15, 2020

If it is used as expected, the answer should be no.

@Rain-31
Copy link
Author

Rain-31 commented May 15, 2020

If it is used as expected, the answer should be no.

https://golang.org/src/time/tick.go?s=1752:1785#L44

is that function make a new channel every loop? or just one channel in every loop

@bcmills
Copy link
Contributor

bcmills commented May 15, 2020

This issue seems to be a question about how to use Go, rather than a feature request or defect report about the Go language and/or toolchain.

We have decided that our experiment to allow questions on the issue tracker has not had the outcome we desired, so I am closing this issue. I'm sorry that we can't answer your question here.

There are many other methods to get help if you're still looking for answers:

Thanks

@bcmills bcmills closed this as completed May 15, 2020
@golang golang locked and limited conversation to collaborators May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants