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

perf(track): reduce webgl memory usage #1057

Merged
merged 2 commits into from
May 6, 2024
Merged

Conversation

etowahadams
Copy link
Contributor

@etowahadams etowahadams commented May 6, 2024

Fix #
Toward #

Interacting with a visualization causes webgl memory to skyrocket. I use about:memory in Firefox to check memory usage.
image
This was because Graphics objects were not being destroyed between draw calls, causing an accumulation of Graphics objects. With this fix, webgl textures memory only gets up to 10-15 MB.

Change List

  • Destroy the Graphics objects in pBorder before redrawing

Checklist

  • Ensure the PR works with all demos on the online editor
  • Unit tests added or updated
  • Examples added or updated
  • Documentation updated (e.g., added API functions)
  • Screenshots for visual changes (e.g., new encoding support or UI change on Editor)

import type * as PIXI from 'pixi.js';
import * as PIXI from 'pixi.js';
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this was not the intended change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@etowahadams etowahadams merged commit 80ed16e into main May 6, 2024
5 checks passed
@etowahadams etowahadams deleted the etowahadams/memory-leak branch May 6, 2024 19:22
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.

None yet

2 participants