# AudioTumbnail memory issue

**URL:** <https://forum.juce.com/t/audiotumbnail-memory-issue/9435>\
**Category:** General JUCE discussion\
**Created:** [October 21, 2012, 12:44pm UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435 "2012-10-21T12:44:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 21, 2012, 12:44pm UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/1 "2012-10-21T12:44:51Z")

</div>

Hi

When opening an audio file for playback in the JuceDemo, memory usage is starting to peak ( I stopped monitoring after it reached 1GB).  
I tired both WAV and MP3 files and it happens to both (Windows machine).

I believe it’s related to the GUI rendering ( thumbnail-\>setFile (audioFile); )

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 21, 2012, 1:53pm UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/2 "2012-10-21T13:53:28Z")

</div>

I still don’t know why but it’s related to drawing the position line, if you take off this line in the timerCallback:

```auto
        currentPositionMarker.setRectangle (Rectangle<float> (timeToX (currentPlayPosition) - 0.75f, 0,
                                                              1.5f, (float) getHeight()));
```

Then It stop leaking.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 21, 2012, 6:32pm UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/3 "2012-10-21T18:32:02Z")

</div>

Hmm… I can’t really see how that could leak. Aren’t you getting some leak warnings on shutdown?

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 21, 2012, 8:22pm UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/4 "2012-10-21T20:22:44Z")

</div>

No, that’s a small mystery…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 22, 2012, 8:45am UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/5 "2012-10-22T08:45:18Z")

</div>

Well if there’s no warnings, then there’s no leak. The thumbnail will temporarily allocate blocks of memory, which the runtime and OS may not reclaim immediately. The memory usage figures that the task manager shows you are practically useless for debugging, you know?

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [October 22, 2012, 9:17am UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/6 "2012-10-22T09:17:40Z")

</div>

I guess you are right, I just don’t understand why this is the only place where this memory explosion is happening in the usage display, I’m also worried about the users’ reaction.

Thanks Jules

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 22, 2012, 10:07am UTC](https://forum.juce.com/t/audiotumbnail-memory-issue/9435/7 "2012-10-22T10:07:55Z")

</div>

Well, if you can give me something more concrete to look at then I will do, but task manager numbers don’t count as admissible evidence in my courtroom.
