New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All tabs but current lose context #99

Closed
vandys opened this Issue Nov 13, 2018 · 12 comments

Comments

Projects
6 participants
@vandys
Copy link

vandys commented Nov 13, 2018

On dev, updated to 703, and Morph has returned to an early behavior where it maintains browser
context for only the current tab. I can have two tabs, but I can clearly see it reload the content
afresh when I switch to the other tab. This is on a freshly booted phone, nothing else competing for memory.

@balcy

This comment has been minimized.

Copy link
Collaborator

balcy commented Nov 13, 2018

yes before #96 no tabs could be unloaded (even if they were closed)
On my phone (Aquaris 4.5) even with only one tab and no other apps open, I see qml: System low on memory, but unable to pick a tab to unload the whole time (and background tabs are always unloaded as you describe)
The calculation of free memory in morph-browser.qml might be inaccurate
var freeMemRatio = (MemInfo.total > 0) ? (MemInfo.free / MemInfo.total) : 1.0 // Under that threshold, available memory is considered "low", and the // browser is going to try and free up memory from unused tabs. This // value was chosen empirically, it is subject to change to better // reflect what a system under memory pressure might look like. var lowOnMemory = (freeMemRatio < 0.2)
-> the ratio of 20% is the threshold
Up to now it always tried to unload tabs too, but because of an error (see mentioned issue / PR) the unload could not finish.

@balcy

This comment has been minimized.

Copy link
Collaborator

balcy commented Nov 13, 2018

should we change the value to 0.15 or 0.1 perhaps ?

@vandys

This comment has been minimized.

Copy link

vandys commented Nov 13, 2018

You may want to look at "avail" as distinct from "free". A default Linux kernel tries to use would-be
idle memory to cache content, but that shouldn't make the browser leap to low memory behavior.
It isn't the end of the world to have Linux sweep through its less used pages and reclaim memory, and certainly preferable
to having a browser which doesn't support background tabs!

@UniversalSuperBox

This comment has been minimized.

Copy link
Member

UniversalSuperBox commented Nov 16, 2018

Looks like it's a misnomer:

int newFree = parsedFree + parsedCached + parsedBuffers;

MemInfo.free is actually the available RAM in the system.

@balcy balcy referenced this issue Nov 19, 2018

Closed

Fix papercuts in Morph-Browser #914

4 of 6 tasks complete

UniversalSuperBox added a commit that referenced this issue Nov 19, 2018

Variablize lowMemoryThreshold to keep tabs open
I've noticed that in morph-browser, the out-of-memory tab loader was a
bit excessive. For some reason, it would unload tabs even when the
system had lots of memory available -- 1GB or more!
Turns out, the `freeMemRatio < 0.2` test always returned true, no
matter what. I'm not sure why this happens, probably a QML+JS quirk.
By moving the low memory threshold into a new variable, the test
returns correctly based on the amount of available memory in the system.
No more unloading of every tab!

Fixes #99

@balcy balcy closed this in #106 Nov 20, 2018

@UniversalSuperBox UniversalSuperBox added this to To do in OTA-6 QA Tracker via automation Nov 23, 2018

@tjrhodes

This comment has been minimized.

Copy link

tjrhodes commented Nov 27, 2018

Device: FP2
System Build: 2018-W48

With 2 or more tabs open the background tabs are always unloaded for me. Only the active tab retains state.

@balcy

This comment has been minimized.

Copy link
Collaborator

balcy commented Nov 27, 2018

yes, the same for me on BQ Aquaris 4.5, maybe we should still lower the threshold value ?

@vandys

This comment has been minimized.

Copy link

vandys commented Nov 27, 2018

maybe we should still lower the threshold value ?

You should check "free -h" from a shell, and if "avail" is a moderately large number, then you
may need to revisit the browser's free memory calculation rather than just lower that
threshold. The latest builds have certainly fixed it for my on my Nexus 5.

@UniversalSuperBox

This comment has been minimized.

Copy link
Member

UniversalSuperBox commented Nov 27, 2018

The Nexus 5 sits at around 700MB of memory used at idle, I'm sure the same is true on other devices. Letting the browser keep things open when less than 20% of memory is available will cause the low-memory killer to kill unity8 far too often. We already removed an important protection against that, so I'm not comfortable decreasing the threshold.

@Andrissk

This comment has been minimized.

Copy link

Andrissk commented Nov 28, 2018

Device: nexus 5
Build: 2018-W48

The tabs seems to retain state with three tabs opened. However previously hidden tabs does not show content on the tab selection screen.

@UniversalSuperBox UniversalSuperBox moved this from To do to Accepted in OTA-6 QA Tracker Nov 28, 2018

@UniversalSuperBox

This comment has been minimized.

Copy link
Member

UniversalSuperBox commented Nov 28, 2018

@Andrissk, that seems like a different issue. Could you file another bug for the tab content?

OTA-6 QA Tracker automation moved this from Accepted to Rejected Nov 28, 2018

@UniversalSuperBox UniversalSuperBox moved this from Rejected to Accepted in OTA-6 QA Tracker Nov 28, 2018

@Andrissk

This comment has been minimized.

Copy link

Andrissk commented Dec 1, 2018

@Andrissk, that seems like a different issue. Could you file another bug for the tab content?

Ok, I have created new bug report - #972.

@hsbyter

This comment has been minimized.

Copy link

hsbyter commented Dec 2, 2018

In 2018-w48 for m10 fhd
The tabs only reload if the browser was closed and you go to the tab for the first time.
After this the tabs do not reload again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment