Hi,
I’m having a problem with a big memory footprint when using CairoMakie to plot big images in the REPL. The code consists of loading four images with load
and then plotting them using image!
(no treatment whatsoever, so I did not include the code, but I can if necessary). If I run the plot code (with the images already loaded) once, it runs fine. But as I run it more times (say, for example, because I’m tweaking some attributes such as xlabel
), julia eventually runs out of memory. I noticed a big memory footprint from my axes (1.4GB each!), although the output of varinfos()
remains constant. Is there a kind of draft mode to reduce this footprint? (I know I could use GLMakie and tweak using Observables, but I find it more convenient to edit a vim buffer and execute its content with vim-slime).
Output of varinfo()
for reference:
julia --project
julia> varinfo()
name size summary
–––––––––––––––– ––––––––––– –––––––
Base Module
Core Module
InteractiveUtils 519.661 KiB Module
Main Module
# Loading images and modules...
julia> varinfo()
name size summary
–––––––––––––––– –––––––––– –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Base Module
Core Module
InteractiveUtils 1.184 MiB Module
Main Module
ans 2.095 KiB Markdown.MD
img_100nm 48.000 MiB 4096×4096 Array{RGB{N0f8},2} with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}
img_10nm 1.286 MiB 605×557 Array{RGBA{N0f8},2} with eltype ColorTypes.RGBA{FixedPointNumbers.N0f8}
img_1um 48.000 MiB 4096×4096 Array{RGB{N0f8},2} with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}
img_pvktoa 48.000 MiB 4096×4096 Array{RGB{N0f8},2} with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}
julia>
# plotting once...
julia> varinfo()
name size summary
–––––––––––––––– –––––––––– –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Base Module
Core Module
InteractiveUtils 1.189 MiB Module
Main Module
ans 1.462 GiB Figure
ax_100nm 1.462 GiB Axis
ax_10nm 1.462 GiB Axis
ax_1um 1.462 GiB Axis
ax_toa 1.462 GiB Axis
f 1.462 GiB Figure
img_100nm 48.000 MiB 4096×4096 Array{RGB{N0f8},2} with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}
img_10nm 1.286 MiB 605×557 Array{RGBA{N0f8},2} with eltype ColorTypes.RGBA{FixedPointNumbers.N0f8}
img_1um 48.000 MiB 4096×4096 Array{RGB{N0f8},2} with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}
img_pvktoa 48.000 MiB 4096×4096 Array{RGB{N0f8},2} with eltype ColorTypes.RGB{FixedPointNumbers.N0f8}