-
Notifications
You must be signed in to change notification settings - Fork 617
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
force update #222
Comments
I implemented something similar but left the original Update function alone (for backwards compatibility), and created an "Update2" function of that does the same code. Below is code I have to trim the maximum lines in the buffer, with some other bug fixes. I should make a PR for this.
|
I would be able to add a function called UpdateAsync(), this way we wouldn't change any existing code and still have the wanted functionalities. What are your thoughts |
Ideally to avoid a unbounded growth it would be nice if there was a maxlines setting as suggested. But yes, the UpdateAsync() would be great. If you agree with that I can send a PR |
Yea totally! Go for it! |
Can you open it on @awesome-gocui we run a fork of this project theere since the original ownwer hasnt responded to anything in a while |
OK, I opened awesome-gocui#67 |
I used
g.Update
to append lines to a text box that scrolls - like a tail -f.Periodically i remove lines from buffer so the size doesnt grow forever, however the fact that g.Update() creates a go routine leaks lots of memory over time. After a few 10k lines you end up with 10k go routines worth of descriptors in memory that will never be freed.
Editing the code and changing update to:
improves things for me drastically without impacting anything noticable. Can you perhaps tell me the reason why Update does this in a go routine? Might we add a
SyncUpdate
or similar that doesnt create a go routine?The text was updated successfully, but these errors were encountered: