[dash] constant increase in memory consumption when navigating through lenses

Bug #1201116 reported by Florian Boucault
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtxmlpatterns-opensource-src (Ubuntu)
Confirmed
Critical
Unassigned
unity8 (Ubuntu)
Opinion
Critical
Daniel d'Andrada

Bug Description

Sorry for the poor steps to reproduce:
1. boot the phone
2. unlock the phone
3. go to apps lens, swipe up and down dozens of times
4. maybe go to the video lens and do the same
5. swipe many times between lenses
6. go to the video lens and open and close various previews dozens of times
7. stop moving entirely

Current result:
CPU usage is easily 15-30%
Memory usage seen as high as 400MB

Expected result:
CPU usage should be 0%
Memory usage should be the same as when the phone was just booted and unlocked, around 90-100MB

Revision history for this message
Michał Sawicz (saviq) wrote :

This feels tricky to reproduce, I've played around with all the scopes and while memory did go up (definitely needs investigation), CPU stayed at a healthy 0%.

After having interacted with the network indicator, though, chewie-network-something has gone CPU-haywire and so went unity8. Will spawn another bug for this if I can reproduce.

Changed in unity8:
assignee: nobody → Daniel d'Andrada (dandrader)
status: New → In Progress
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

I agree the memory leak is one bug and the constant CPU consumption is another one. I say let's focus on the memory leak for this one.

Opening and closing video preview does increase the memory usage significantly. But it seems like pretty much anything does.
I left a device on overnight (with display off) and connected to a wifi network. Otherwise it was absolutely idle. Here are the results:

phablet@ubuntu-phablet:~$ pmap --device 3097 | grep writeable/private
mapped: 333780K writeable/private: 194276K shared: 56036K
 jul 22 17:27

phablet@ubuntu-phablet:~$ pmap --device 3097 | grep writeable/private
mapped: 334804K writeable/private: 195452K shared: 56036K
 jul 22 17:44

phablet@ubuntu-phablet:~$ pmap --device 3097 | grep writeable/private
mapped: 346068K writeable/private: 206944K shared: 56036K
 jul 22 20:22

phablet@ubuntu-phablet:~$ pmap --device 3097 | grep writeable/private
mapped: 405460K writeable/private: 265840K shared: 56036K
 jul 23 09:52

So it's memory consumption increases constantly even if the user doesn't interact with it.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The constant increase in memory consumption comes from QImageData::create() calls. Now I gotta find the code path that leads to those calls.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

So it seems we are leaking pixmaps created by the QML engine. Don't know yet whether it's Qt's or unity8's fault.
Will continue stripping down unity8 to the simplest test case.

Gema Gomez (gema)
tags: added: qa-touch
Revision history for this message
Daniel d'Andrada (dandrader) wrote : Re: [dash] constant increate in memory consumption when navigating through lenses

That constant increase in memory consumption (without user interaction) also happens with a very simple Qml app.

summary: - [dash] combined memory leak & constant CPU usage when navigating through
+ [dash] constant increate in memory consumption when navigating through
lenses
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

I am able to reproduce the memory increase with a minimal unity8 setup (only Dash and, in the Dash, only the Videos scope) running on x86, but it only happens when there's user interaction. Unlike on the device where it happens constantly, by itself.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The constant memory increase that happens without user interaction is caused by platform-api:
https://bugs.launchpad.net/platform-api/+bug/1206146

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Another source of memory leak is Qt's XmlListModel.

Bug reported:
https://bugreports.qt-project.org/browse/QTBUG-32745

summary: - [dash] constant increate in memory consumption when navigating through
+ [dash] constant increase in memory consumption when navigating through
lenses
Changed in unity8:
status: In Progress → Triaged
Revision history for this message
Michał Sawicz (saviq) wrote :

Let's revisit this when we've got the other ones fixed.

Changed in unity8:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtdeclarative-opensource-src (Ubuntu):
status: New → Confirmed
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

qtxmlpatterns is a better source package for this. Upstream bug is still open.

affects: qtdeclarative-opensource-src (Ubuntu) → qtxmlpatterns-opensource-src (Ubuntu)
Leo Arias (elopio)
tags: added: qa-daily-testing rtm14
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

FWIW, I tested this on Utopic 160, and have memory usage graphs for the result.

Memory use went up while scrolling around scopes, and it went up each time I went to a scope I hadn't used yet or hit the "see more" button. After that though, it stayed relatively consistent.

Memory use also went up when the screen turned itself off, then went back down after unlocking the screen. It's near the right side of the graph.

In any case, it doesn't seem like a big issue right now at least for relatively short amounts of time like 15 minutes.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :
tags: removed: rtm14
Revision history for this message
kevin gunn (kgunn72) wrote :

Since there are 2 other bugs

memory leak in Qt's XmlListModel. https://bugreports.qt-project.org/browse/QTBUG-32745
and https://bugs.launchpad.net/platform-api/+bug/1206146

i'm marking this opinion for unity8 (for now)

Changed in unity8:
status: Incomplete → Opinion
Changed in qtxmlpatterns-opensource-src (Ubuntu):
importance: Undecided → Critical
Michał Sawicz (saviq)
affects: unity8 → unity8 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.