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

Prevent memory surge in two examples #2092

Merged
merged 1 commit into from Jun 22, 2021
Merged

Conversation

almarklein
Copy link
Member

Closes #1871

The problem is that if updates are done, these are encoded as GLIR commands, which end up in a queue. You can imagine that this queue becomes a problem if it is not emptied. If a Qt window is minimized, it won't invoke a draw event, so the queue is not flushed, and it builds up.

The solution/workaround is to call canvas.context.flush() explicitly. There are multiple examples affected by this. Basically any example that does any update to a GPU buffer, texture or program. However, most these updates are so small that it does not show a noticable memory increase (no increase seen in the process manager). These two examples change so much data at such a high speed that it does matter.

@rossant here's a nasty downside of the GLIR queue :) On the long run it could be worth examining if we can get rid of the queue completely, since all our GLIR backends are local and can be flushes immediately ...

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge if you'd like

@almarklein almarklein merged commit e515b00 into vispy:main Jun 22, 2021
@almarklein almarklein deleted the memsurge branch June 22, 2021 13:44
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

Successfully merging this pull request may close these issues.

memory surge after minimizing the vispy window
2 participants