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

Memory leak? #42

Open
ffevotte opened this issue Feb 17, 2024 · 0 comments
Open

Memory leak? #42

ffevotte opened this issue Feb 17, 2024 · 0 comments

Comments

@ffevotte
Copy link

Hi,

when running a simple script like this:

using GraphViz
using FileIO

function foo()
    g = dot"""
      digraph graphname {
        a -> b -> c;
        b -> d;
      }
    """
    FileIO.save("graph.svg", g)

    GraphViz.free(g)  # This should be called as a finalizer, but let's be explicit
    nothing
end

for i in 1:1000
    i % 10 == 0 && println(i)
    foo()
    GC.gc()
end

# It's convenient to wait in the end; this makes it easy to check the final
# memory consumption with something like `top`
println("Done. Press ^C to abort")
sleep(3600)

one can readily see with a tool like top that the memory consumption of the Julia process slowly but surely increases. On my system, resident memory is around 275Mb for the first few iterations, and increases to around 305Mb after the 1000th.

Explicitly calling free does not seem to change anything, so it would look like the issue is more subtle than a finalizer not being called.

Is that an issue with my code? Or is there a memory leak somewhere? (And in the latter case, do you think it is an upstream issue or an issue with GraphViz.jl?)

Thanks in advance!

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

1 participant