# Frame-Heavy Gifs

**URL:** <https://discourse.julialang.org/t/frame-heavy-gifs/11243>\
**Category:** Visualization\
**Created:** [May 29, 2018, 5:25pm UTC](https://discourse.julialang.org/t/frame-heavy-gifs/11243 "2018-05-29T17:25:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oz\_Wilson](https://avatars.discourse-cdn.com/v4/letter/o/ea666f/32.png) [@Oz\_Wilson](https://discourse.julialang.org/u/Oz_Wilson)\
**Post date:** [May 29, 2018, 5:25pm UTC](https://discourse.julialang.org/t/frame-heavy-gifs/11243/1 "2018-05-29T17:25:32Z")

</div>

I am trying to create a gif with 100 frames, which I assume shouldn’t be a problem if I code it correctly. However, the following code slows to a crawl, and seems to cause a memory leak.

```julia
using Plots
using ProgressMeter

u = rand(100,100)
hmap = heatmap(zeros(size(u)), clim=(0,1))

p = Progress(1000, 1)

anim = Animation()

for i=1:1000
    u = rand(100,100)
    heatmap!(hmap[1],u)
    if mod(i,10) == 0
        frame(anim)
    end
    next!(p)
end

gif(anim, "/tmp/anim_fps30.gif", fps=30)

```

Have I made a critical error in my coding? Is there a way to get frames for the animation without holding them all in memory? Thanks.
