'Image', binary resources and dynamic memory

Continuing the discussion from Basic Question about juce::Image:


I want to use strictly heap memory for all my GUI images (1+ MB). Would loading images from hard drive involve using only heap memory of the Juce based program if I used ‘loadFromFile’ directly to ‘Image’?

Also, would I completely avoid using any stack and static memory by keeping all my binary image data in a binary source file working with Juce? When I looked into example project with BinaryData:: using extern linkage it doesn’t seem that way. It seems like this is static memory based method.

PS Juce version I am finishing and old project if it’s relevant to this question.

Thanks in advance,

Why? Heap memory isn’t qualitatively different from static or stack memory. And 1MB is a trivial amount of data in modern systems. Not sure what problem you imagine this would solve, but it sounds a bit of an odd thing to ask…

Really? I thought the main difference between stack and static memory and heap is that heap is limited only by installed memory on the system. I was almost certain that since I started using bigger files for my plugin GUI and more of them my GUI objects started leaking memory in some way, crash every odd time the DAW on start up, but only some of the time, or I would see graphical glitches on some of the interface elements.

If you say it cannot be an issue then it must be something else.