Makie memory leak?


I do not understand why the following MWE consumes more an more memory until crash:

 using GLMakie,AbstractPlotting,ImageCore
function leak(img,i)
    scene = AbstractPlotting.image(rotr90(img), show_axis = false);, scene; resolution = (1920,1088), px_per_unit = 72)

function nleak(nf)

    for i=1:nf
        img = rand(RGB{N0f8}, nx, ny)
        @info "Size of AbstractPlotting: $(Base.format_bytes(Base.summarysize(AbstractPlotting)))"

Any hints ?

Maybe you plot many images into the same scene. I dont remember its behaviour…

I don’t know. The calling nleak function does not create any Makie related object. Hence I would assume that every Makie objects should be destroyed (or ready for GC) at the leak function exit…

What version are you on? Can you try with latest AbstractPlotting /GLMakie? Something similar was supposed to be fixed recently

Hi, I think that my system is up to date:

Status `~/Projects/video_grid.jl/MWE/Project.toml`
  [537997a7] AbstractPlotting v0.14.3
  [3da002f7] ColorTypes v0.10.9
  [5ae59095] Colors v0.12.5
  [e9467ef8] GLMakie v0.1.21
julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
  JULIA_EDITOR = "/snap/code/52/usr/share/code/code"

I also try to use the master version with the same outcome:

(MWE) pkg> status
Status `~/Projects/video_grid.jl/MWE/Project.toml`
  [537997a7] AbstractPlotting v0.14.3 ``
  [e9467ef8] GLMakie v0.1.21 ``

Could you please file an issue at Makie.jl with this MWE then? So far these things have been caused by lingering observable connections, and they tend to be hard to catch

1 Like

Just a wild guess, sorry if it is misleading, but can it be related to Generated code memory leaks · Issue #14495 · JuliaLang/julia · GitHub?

1 Like

Yeah Makie had a couple of problems lately, which is why I created GitHub - SimonDanisch/MemoryHunter.jl: Hunting memory leaks… I’ll take a look at your mwe once I have time!


OK thank you for your answer… and good luck with the investigation !
I was not sure since the memory leak issues I have found on github were closed.
Should I post a new issue ?

The issue is here

BTW, is it possible (useful) to plot CuArrays with Makie ?