← Back to team overview

touch-packages team mailing list archive

[Bug 1364404] Re: qmlscene is leaking ~1.7K per second on an idle application on the phone

 

I think the issue is that a thread is reading sensor data and leaking
memory, I put a breakpoint on mprotect calls and found most are from:

(gdb) where
#0  mprotect () at ../sysdeps/unix/syscall-template.S:82
#1  0xb5eeb19c in grow_heap (diff=4096, h=0xb1400000) at arena.c:617
#2  sysmalloc (av=0xb1400010, nb=72) at malloc.c:2387
#3  _int_malloc (av=av@entry=0xb1400010, bytes=bytes@entry=64) at malloc.c:3800
#4  0xb5eec122 in __GI___libc_malloc (bytes=64) at malloc.c:2891
#5  0xb60420f4 in operator new(unsigned int) ()
   from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
#6  0xb629e1a8 in QObject::QObject(QObject*) ()
   from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#7  0xb3a86eb4 in QSensorReading::QSensorReading(QObject*, QSensorReadingPrivate*) () from /usr/lib/arm-linux-gnueabihf/libQt5Sensors.so.5
#8  0xb3a890f8 in QAccelerometerReading::QAccelerometerReading(QObject*) ()
   from /usr/lib/arm-linux-gnueabihf/libQt5Sensors.so.5
#9  0xb1fb123c in ?? ()
   from /usr/lib/arm-linux-gnueabihf/qt5/plugins/sensors/libqtubuntu_sensors_plugins.so
#10 0xb1f9f9fc in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)


I wonder if the sensor object pool is not freeing memory, there is an interesting comment:

void core::SharedAccelerometer::onAccelerometerReading(UASAccelerometerEvent *event)
{
    Q_ASSERT(event != NULL);

    // TODO(tvoss): We should rely on an object pool to recycle accelerometer reading
    // instances here. We could use a custom deleter for the shared pointer to put
    // instances that have been successfully delivered to slots back into the pool.
    QSharedPointer<QAccelerometerReading> reading(new QAccelerometerReading());

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to qtdeclarative-opensource-
src in Ubuntu.
https://bugs.launchpad.net/bugs/1364404

Title:
  qmlscene is leaking ~1.7K per second on an idle application on the
  phone

Status in “qtdeclarative-opensource-src” package in Ubuntu:
  New

Bug description:
  Running apps on the phone using qmlscene and just keeping *idle* one
  can see ~1.7K per second of heap growth.  I monitored qmlscene for
  ~570 minutes and observed 58156K of anonymous mapped memory (normally
  this is heap) growth.

  Running smemstat on qmlscene, for example, an idle calendar app:

  ps -ax | grep calendar.qml | grep -v grep
  14006 ?        Ssl    8:26 /usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene calendar.qml

  smemstat -p 14006 60
  Change in memory (average per second):
    PID       Swap       USS       PSS       RSS User       Command
   14006     0.0 B  1706.7 B  1706.7 B  1706.7 B phablet    /usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene
  Total:     0.0 B  1706.7 B  1706.7 B  1706.7 B

  ...etc

  This seems to be a similar leak rate to bug 1364380 so it may be a
  common library that is the root of the problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1364404/+subscriptions


References