Priority: Not Evaluated
Affects Version/s: 5.12.9, 6.0.0
Fix Version/s: None
Environment:custom embedded device (qt5.12.9) followed by a ubuntu 20.10 to track down the issue (qt 5.12.9 and then 6.0.0 to check if already fixed)
Tracking down why I got sometime a OOM killer in my app, I found that multiple calls to the same qmlRegisterType or qmlRegisterUncreatableType leads to the memory growing again and again. I had a loop every 10ms, that created an object by copy which has in it's constructor, a call to the qmlRegisterUncreatableType function. Commenting this line let the issue disappear.
Workaround is to create a static boolean variable to init the qml type only once.
The issue is NOT present with qRegisterMetaType. I didn't tried all function available.
Issue is not visible with valgrind, so it's not some kind of dynamic allocation not freed.
Minimal example code to reproduce in Qt6.0.0 :
I created a minimal QtQuick Application - Empty and changed the main function.
The example use quint8 as class to register but it fail with any other class.
Start the app, launch htop and look the RES column,
then comment the qmlRegisterUncreatableType, and compare the RES column.
We should not get a growing memory usage for a call to the exact same registered object.