[Qt-qml] About QML, JavaScript and garbage collection

Timo.Rouvinen at nokia.com Timo.Rouvinen at nokia.com
Wed May 11 13:32:26 CEST 2011


Hey!

I have been working with some out-of-memory cases on Symbian HW. At least for me it seems that the  common understanding of QML application / JavaScript memory management is  that 'don't do anything, the garbage collector manages the memory for you'. This is assuming that the JavaScript code is such that it allows the garbage collector to deallocate items. For many cases this seems to work OK.

However I've noticed in some occasions where the memory has ran out (the Symbian max heap size is reached) that I can 'solve' the problem by manually invoking gc() from JavaScript block to free memory for the next use case.

So the question is: what triggers the garbage collector?

Seems that in an environment that has limited amount of heap you don't always have the luxury of waiting for GC to do its job; is it then OK and advisable to invoke gc() manually?

Br,
Timo



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110511/63df0bd7/attachment.html 


More information about the Qt-qml mailing list