Merge lp:~osomon/webbrowser-app/fine-tune-memory-pressure-handler into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1455
Merged at revision: 1452
Proposed branch: lp:~osomon/webbrowser-app/fine-tune-memory-pressure-handler
Merge into: lp:webbrowser-app
Diff against target: 67 lines (+12/-13)
2 files modified
src/app/webbrowser/Browser.qml (+9/-11)
src/app/webbrowser/BrowserTab.qml (+3/-2)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/fine-tune-memory-pressure-handler
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+294117@code.launchpad.net

Commit message

Fine-tune the custom memory-pressure handler, from data gathered on several devices.

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1452
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/482/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/484
    FAILURE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/38/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/484
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/483
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/483
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/490
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/490/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/490
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/490/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/490
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/490/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/490
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/490/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/490
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/490/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/490
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/490/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/482/rebuild

review: Needs Fixing (continuous-integration)
1453. By Olivier Tilloy

Switch back to a percentage-based threshold after some more extensive testing, and change the value to 20% (was initially 30%).

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1453
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/483/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/485
    UNSTABLE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/39
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/485
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/484
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/484
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/491
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/491/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/491
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/491/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/491
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/491/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/491
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/491/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/491
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/491/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/491
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/491/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/483/rebuild

review: Needs Fixing (continuous-integration)
1454. By Olivier Tilloy

Force garbage collection after unloading a tab, to reclaim the memory used by the webview.

1455. By Olivier Tilloy

Fix the lastCurrent timestamp type for browser tabs, to avoid integer overflow.

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1454
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/484/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/486
    UNSTABLE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/40
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/486
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/485
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/485
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/492
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/492/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/492
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/492/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/492
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/492/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/492
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/492/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/492
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/492/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/492
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/492/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/484/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1455
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/485/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/487
    FAILURE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/41/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/487
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/486
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/486
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/493
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/493/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/493
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/493/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/493
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/493/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/493
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/493/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/493
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/493/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/493
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/493/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/485/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2016-04-15 11:37:54 +0000
3+++ src/app/webbrowser/Browser.qml 2016-05-09 17:57:26 +0000
4@@ -1454,14 +1454,6 @@
5 readonly property bool hasMouse: (miceModel.count + touchPadModel.count) > 0
6 readonly property bool hasTouchScreen: touchScreenModel.count > 0
7
8- readonly property real freeMemRatio: (MemInfo.total > 0) ? (MemInfo.free / MemInfo.total) : 1.0
9- // Under that threshold, available memory is considered "low", and the
10- // browser is going to try and free up memory from unused tabs. This
11- // value was chosen empirically, it is subject to change to better
12- // reflect what a system under memory pressure might look like.
13- readonly property real lowOnMemoryThreshold: 0.3
14- readonly property bool lowOnMemory: freeMemRatio < lowOnMemoryThreshold
15-
16 function getOpenPages() {
17 var urls = []
18 for (var i = 0; i < tabsModel.count; i++) {
19@@ -1838,9 +1830,15 @@
20 }
21
22 Connections {
23- target: internal
24- onFreeMemRatioChanged: {
25- if (internal.lowOnMemory) {
26+ target: MemInfo
27+ onFreeChanged: {
28+ var freeMemRatio = (MemInfo.total > 0) ? (MemInfo.free / MemInfo.total) : 1.0
29+ // Under that threshold, available memory is considered "low", and the
30+ // browser is going to try and free up memory from unused tabs. This
31+ // value was chosen empirically, it is subject to change to better
32+ // reflect what a system under memory pressure might look like.
33+ var lowOnMemory = (freeMemRatio < 0.2)
34+ if (lowOnMemory) {
35 // Unload an inactive tab to (hopefully) free up some memory
36 function getCandidate(model) {
37 // Naive implementation that only takes into account the
38
39=== modified file 'src/app/webbrowser/BrowserTab.qml'
40--- src/app/webbrowser/BrowserTab.qml 2016-02-23 11:24:26 +0000
41+++ src/app/webbrowser/BrowserTab.qml 2016-05-09 17:57:26 +0000
42@@ -39,7 +39,7 @@
43 readonly property url icon: webview ? webview.icon : initialIcon
44 property url preview
45 property bool current: false
46- readonly property int lastCurrent: internal.lastCurrent
47+ readonly property real lastCurrent: internal.lastCurrent
48 property bool incognito
49 visible: false
50
51@@ -105,6 +105,7 @@
52 restoreState = webview.currentState
53 restoreType = Oxide.WebView.RestoreCurrentSession
54 webview.destroy()
55+ gc()
56 }
57 }
58
59@@ -127,7 +128,7 @@
60 id: internal
61 property bool hiding: false
62 property var incubator: null
63- property int lastCurrent: 0
64+ property real lastCurrent: 0
65 }
66
67 // When current is set to false, delay hiding the tab contents to give it

Subscribers

People subscribed via source and target branches

to status/vote changes: