Skip to content

Potential memory leak with very big svg rendered #111

@Kingwzb

Description

@Kingwzb

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions