Skip to content

Makie memory leak? #795

@LaurentPlagne

Description

@LaurentPlagne

The following MWE consumes more an more memory until crash:

using GLMakie,AbstractPlotting,ImageCore
function leak(img,i)
    fn=string(i)*".png"
    scene = AbstractPlotting.image(rotr90(img), show_axis = false);
    AbstractPlotting.save(fn, scene; resolution = (1920,1088), px_per_unit = 72)
    nothing
end

function nleak(nf)
    nx,ny=1920,1088

    for i=1:nf
        img = rand(RGB{N0f8}, nx, ny)
        leak(img,i)
        @info "Size of AbstractPlotting: $(Base.format_bytes(Base.summarysize(AbstractPlotting)))"
        GC.gc(true)
    end
end
nleak(200)
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
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = "/snap/code/52/usr/share/code/code"
  JULIA_NUM_THREADS = 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions