[Interest] Question to members of the Qt team: why does an empty project consumes so much memory on iOS?

Hamish Moffatt hamish at risingsoftware.com
Thu Apr 23 11:23:40 CEST 2015


On 21/04/15 22:35, Robert Iakobashvili wrote:
> On Tue, Apr 21, 2015 at 3:12 PM, Nuno Santos <nunosantos at imaginando.pt> wrote:
>> Robert,
>>
>> I could but it is useless. I need qml, the whole app view is written on it.
>>
>> Regards,
>>
>> --
>> Nuno Santos
>>
> What I've seen is that all my GUI, rather complex,
> takes only 8 MB, but it is written all in widgets, no QML.
>
> That leaves me memory for my applications logic
> that requires a lot of memory.
>

I'm just starting to look at the memory usage of our iOS apps as I have 
seen memory warnings from the OS with one of the more 
graphics/multimedia intensive ones. But even our simplest are using 
around 60Mb once all loaded. Our app is pure widgets, on Qt 5.4.1.

A few things I notice. I'm observing memory usage through the "real mem" 
measurement in the Apple Instruments tool.

When I call QResource::registerResource to load an external resource, 
the memory usage grows by the file size. I have an 18Mb resource in one 
app. I thought resources were mapped with mmap()? And thus virtual 
memory should grow but not real. It's compiled with "rcc -no-compress", 
although rcc isn't trying to compress it anyway (it contains compressed 
audio files).

The main UI consists of lots of widgets in various pages of a 
QStackedWidget. Just the call to "ui.setupUi(this)" causes the memory 
size to grow by 10Mb, and then showMaximized() causes it to jump another 
8Mb.

After that we load some database stuff and memory usage keeps growing. I 
haven't stepped through that yet.

Are there other tools at my disposal here I should be trying?

Hamish



More information about the Interest mailing list