How much heap memory for Symbian C++/QML application
-
Hi,
I am developing an application for Symbian devices which uses Qt C++ and QML.
Recently I found that my app consumes more then 8 MB of heap memory, which causes it to crash.
I know I can increase memory using EPOCHEAPSIZE, but I wonder whether 8 MB heap usage is OK or too much?I tested my app on Nokia C7 with Qt 4.7.3. My app has image provider, few screens and ListView with animated elements.
I use C++ models to provide data to QML elements which show the data.
Before calling QDeclarativeView::setSource I can see that heap consume is less then 2MB.
After calling QDeclarativeView::setSource heap usage is near 6 MB.Thanks in advance !
-
During investigations I found some interesting things .
Every time data() method of my model, derived from QAbstractListModel, is called memory usage increases. (more precisely: every time when I call data method memory consumption is logged and I can see it increases) This happens for every role and each role has its own amount of increased memory
After searching the forum I found "that":http://developer.qt.nokia.com/videos/watch/creating-performant-qt-quick-apps I can make two improvements.
First: Image of my list item is loaded from image provider, source property of Image element was constructed from other properties of the list item. Because I formed string from properties in the qml, there were too much bindings in the ListView delegate; I added new role to my model
Second: Every time I added an item to the model I called beginResetModel and endResetModel; Now I call: begin/end InsertRows.
This helped but still memory ends at some point. So I didn't hesitate and added to my pro file:
@
TARGET.EPOCHEAPSIZE = 0x800000 0x2000000
@