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

Potential memory leak with very big svg rendered #111

Open
Kingwzb opened this issue Jan 22, 2025 · 1 comment
Open

Potential memory leak with very big svg rendered #111

Kingwzb opened this issue Jan 22, 2025 · 1 comment

Comments

@Kingwzb
Copy link

Kingwzb commented Jan 22, 2025

I have implemented logic to trace my program's logic units' interaction using graphviz diagram(it is huge one with dozen MB each), and I found each time I rendered the svg file, my go process memory shoot up significantly and it doesn't come down to expected level after garbage collected. (I have properly called the rendered graph's close and the graphviz instance's close for each call)

From golang's pprof tool, I can see the WASM part is retaining huge amount of memory
Image

I created instance of graphviz in each call and after rendered the svg file, I close both, should I only create one global graphviz instance instead ?
graphviz.New(ctx)

@cschneider4711
Copy link

cschneider4711 commented Jan 23, 2025

Same here, can confirm a potential memory leak (or other ways of growing memory over time) when often using the SVG rendering. Was the same in the non-Wasm kind, but the Wasm style seems to trigger this quicker and/or heavier.

Especially when the application is running in some kind of server mode, where it doesn't get restarted frequently, even small SVG graphs constantly increase (in slower steps) the overall memory usage constantly over time.

BTW: Kudos to the Wasm migration of this library, that really rocks generally and is awesome! Thx for this great project!

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

2 participants