Issue with Tab Hibernation
-
@Shrinra I would do a standalone install.
https://gist.github.com/ruario/0e4f90caa59a390c4a56 -
@luetage said in Issue with Tab Hibernation:
Wow...that was really cool! It completely solves the issue of not being able to easily have two installations on Vivaldi on my Mac, each with a separate profile. I did not know how to do that.
Anyways, I tested the 1.11 Snapshot, and from what little testing I did, my tabs hibernated properly with macOS showing that all of the processes in question were terminated.
I can't be sure what the issue is. After all, my test was on a completely different version of Vivaldi with a new, fresh profile, and no extensions installed. It's possible that the issue was a bug that was resolved in 1.11, but couldn't it also be the result of an old, crusty profile or a badly behaved extension? My profile goes back to the early Technical Preview days, so I suppose that's always a possibility.
I'm not sure though. Maybe I will wait until 1.11 is officially out and see what happens after I upgrade my Stable build to that.
-
You can try with a fresh profile. Just quit Vivaldi, rename your default folder (eg default123), and restart Vivaldi -- this will create a new profile. Info
-
I have more to report on this issue. It has even got weirder. Yesterday, I restarted Vivaldi (because the memory footprint had gotten unbearably large again) and then immediately took a look at the inbuilt Task Manager. All that I saw was a process for the existing tab I was on, a process for all of my extensions, and both the "Browser" and Vivaldi app processes. This is all normal and is to be expected.
But, I noticed as I browsed, that it seemed like processes (and the accompanying memory bloat) were being created for tabs that were completely hibernated and hadn't once been loaded since I started up Vivaldi. I would see a process ID for the tab and resources being allocated to it in macOS Activity Monitor, as well as the Vivaldi Task Manager. To give an example, I would see a process that contained five tabs (due to process-per-site-instance, I think) and took up almost 400MB of memory. Yet, when I went to look at the tabs in Vivaldi, they all showed as dimmed/hibernated/unloaded. In addition, when I clicked on one, it did load from scratch showing that it wasn't loaded.
Afterwards, I restarted the browser again and the same exact thing happened. Before I knew it, the Task Manager was showing 50 tabs as active with resources allocated to them, despite the fact that I had only clicked on/interacted with 5 tabs since restart.
I decided to test the same session in the Vivaldi 1.11 Snapshot, so I saved one windows worth of my tabs with Vivaldi's built-in Session Manager. I then went to the Session Folder within my profile (Default > Sessions) and copied the .bin file into the corresponding folder within the Snapshot's profile. I launched 1.11, opened the Session, and then clicked on each tab to load it. Then, I tried hibernating a tab, and the same thing happened!
I suppose the issue might be with my sessions? Is that even possible? And, if it is, is there anyway to fix this? I don't want to discard them and start from scratch. I have some saved from some projects that I have to keep, and don't want to have to get rid of two years of organized browsing snapshots.
-
I have been looking at this issue more, and I am still confused. I don't think it is completely a Mac thing any longer and I feel that I am probably misunderstanding how this feature is supposed to work.
Whenever I start up Vivaldi and resume my session, again, I notice that with each tab I click on to load, it is grouped with a bunch of other tabs that have not been touched since the browser has been launched.
For example, I will click on tab #1, and then in the Task Manager/Activity Monitor, it will show tab 1 with an active process and somehow grouped with 4-5 other tabs that I never touched! It will show the group together in one process with resources assigned to them. Yet, these tabs that I didn't touch are dimmed and show as unloaded in Vivaldi. Also, whenever I click on the these tabs to load them, they load, showing that the browser does correctly show them as unloaded.
Next, if you go through the browser and load 5 more random tabs, you will see the above reoccur. What I see is that I've only purposely loaded 4-5 tabs since launching the browser, but the Vivaldi Task Manager is showing 40-45 tabs as being loaded with the RAM to account for them. (I've only loaded 3 tabs, but Vivaldi is currently using 3GB of memory because of all of these zombie tabs.) Again, there is a disconnect somewhere because Vivaldi shows them as dimmed/unloaded, and when you right-click, there is no option to hibernate.
Also, when a tab has a sole process to itself, which is not always the case due to Chromium's default process-per-site-instance model, the process will not terminate and release resources when the tab is hibernated. Vivaldi will show it as unloaded and it will not be present in the Task Manager, but macOS still shows it as active (and thereby chewing up resources). Furthermore, when you reload that hibernated tab, the Vivaldi Task Manager will show that it is using the exact same process ID as before. If it truly was terminated, then I cannot imagine that it would be the case. Please note that I was not able to get Windows 10 to do this. It reliably killed processes when a tab was hibernated. However, the phantom/zombie tab issue after relaunch described above (4-5 tabs ballooning to 40-45 in the Vivaldi Task Manager) was OS agnostic.
(macOS did reliably terminate processes and release resources when a tab was closed; this whole issue only happens with hibernation.)
As a whole, this issue makes Vivaldi hard to use for me as tab hibernation is extremely ineffective. I was drawn to Vivaldi because of this feature. I use large numbers of tabs, and this functionality finally makes using a Chromium-based browser possible.
I will be submitting this as a bug report. It is 100% possible that everything is working as intended and that I misunderstand what this feature is supposed to do, but it could not hurt in my opinion
-
It appears that the issue that I am experiencing is a Chromium issue regarding empty renderer processes not being cleaned up after hibernation (or "discarding" in Chromium parlance).
Tab discarder: Empty renderer processes are not killed
When discarding two tabs sharing a renderer, memory is not freed
Tab discarding not working on macOSI will stop harping on this issue here as it clearly is not a Vivaldi issue.
I've tested manual tab discarding in Google Chrome Canary 62 and the renderer/helper processes successfully terminated after every discard. It appears that there is some relief on the horizon, but assuming that 62 contains the fix, it will take a few months to reach Vivaldi, unfortunately. (Note: I did not have Chromium 61 to test, so it might come sooner!)
-
I have a quick update on this issue in case anyone else was experiencing it.
With the elevation of Chromium 61 to the stable channel yesterday, I tested tab discarding/hibernating and am happy to say that it works as expected 100% of the time. Renderer processes now terminate as they should when a tab is hibernated. Based on the changes to the chrome://discards page, it seems as if Google significantly revamped tab discarding with this release too.
I am now eagerly awaiting the arrival of the first Vivaldi Snapshot that rides on top of 61. This has been a long time coming for me!
-
As expected, the feature seems to work perfectly on Vivaldi 1.12/Chromium 61. I just tested the newest released snapshot.
-
@shrinra That's great news! Thanks very much for the update!
-
@xyzzy Yes, it is! This will make the browser so, so much better for me. Right now, Vivaldi 1.11 is using almost 7 GB of RAM with 7 tabs loaded (many more are hibernated, of course) and 6 extensions. Once 1.12 comes out, I imagine that it will be a fraction of that, causing my whole system to noticeably improve too!
-
I am again experiencing the same issues with tab hibernation in stable 1.12 (on both Mac and Windows). After hibernation, the accompanying renderer processes just do not terminate or release memory. Before I closed down Vivaldi this evening it was using 12GB of memory and causing my MacBook Pro to swap like crazy.
So, I tested a fresh, clean copy of Vivaldi 1.12 (standalone) and it works as expected. While there was an issue with this, it was fixed, so it seems as if there is an issue with my installation. Is there any way that I can repair it? Is there anything that I can "clean" out of the profile that might help? I would definitely rather not start from scratch if I don't have to.
Edit: I tried the steps listed here. Using my main installation with a new profile worked perfectly. I now know that my profile is messed up. I just have to figure out what the culprit is.
-
@shrinra A corrupted profile could cause any of a number of problems. Depending on the damage, you might be able to recover or you might have to start fresh.
Just out of curiosity, are you running multiple instances of Vivaldi (normal install and standalone install) simultaneously, or going back and forth between running Stable and Snapshot releases with the same profile, or all of the above?
-
@xyzzy said in Issue with Tab Hibernation:
@shrinra A corrupted profile could cause any of a number of problems. Depending on the damage, you might be able to recover or you might have to start fresh.
Just out of curiosity, are you running multiple instances of Vivaldi (normal install and standalone install) simultaneously, or going back and forth between running Stable and Snapshot releases with the same profile, or all of the above?
I have two instances of Vivaldi on my Mac. I have the stable version, which is installed in the Applications folder, and I have a standalone version installed elsewhere for use with Snapshots. I do not use them simultaneously. If I want to use the Snapshot version, I close the Stable version, and vice versa.
I do not mix profiles. Each instance has its own profile. However, my stable profile goes back to 2015 and the early Developer Previews of Vivaldi. Perhaps that has something to do with it.
I disabled all extensions. I've cleaned out the Cache and Application Cache. Also, I noticed that my topsites file was nearly 250MB, so I deleted that and started over from scratch. I'm still having the issue, so I will continue to chug away.
-
I just tried something and got an interesting result. In my current, screwed up Vivaldi stable installation, I saved all of the open tabs in one of my windows as a session. Then I got that session file from the profile, copied it into the good, working standalone install's profile, restored the session, and then tested tab hibernation. And it did not work at all! The renderer processes did not terminate. After that, I opened up a new window in the standalone instance, launched a bunch of tabs, and then hibernated them. They all hibernated.
I guess I am going to have to start over completely from scratch, and I've apparently lost 2 years worth of saved sessions to boot. This is turning into a disaster.
-
This is not Mac specific, I'm on Windows and have already confirmed this on the bug tracker. I never checked on Linux, as I use fewer tabs on it, but it must be the same.
As far as my tests went this bad behaviour starts when you go over ~25 tabs, loading pages from the same site seems to make it easier to reproduce. At least now this bug is not as bad, on older internal versions even closing the tab could not kill the process.
-
@an_dz Yes, you are correct. I was able to reproduce it on Windows at work this morning. I do use large numbers of tabs, so that makes sense, and it it would explain why a new profile with less than ten tabs works.
Unfortunately, this makes Vivaldi somewhat unusable for me. Having to restart the browser all the time to kill the renderer processes is a pain.
I had been able to reproduce it on Chromium as well, though, so I figured that it was an issue with that. But, Chromium 61 and higher work well for me now.
I put a bug in for this awhile ago, but I have no access to the tracker, so I'm kind of stumbling around a lot on this.
-
@shrinra said in Issue with Tab Hibernation:
I had been able to reproduce it on Chromium as well, though, so I figured that it was an issue with that.
I thought it was a Chromium bug, but never went to check it.
But, Chromium 61 and higher work well for me now.
So Chromium 61 works? The processes really die? Or is it with C62?
I put a bug in for this awhile ago, but I have no access to the tracker, so I'm kind of stumbling around a lot on this.
Tell me the VB number and I can check it, but it probably was closed as a duplicate of VB-22444.
-
@an_dz said in Issue with Tab Hibernation:
I thought it was a Chromium bug, but never went to check it.
There definitely was an issue with Chromium itself, but I have not had any issues with Chromium 61 or later. I think they fixed the issue. If you look at chrome://discards in 60 and earlier, vs 61 and later, there is a difference in options, so I believe they made some changes to discarding. I had the same issue in vanilla Chromium 60 that I did with Vivaldi 1.11, for instance, but Vivaldi 1.12 does not work reliably while Chromium 61 does.
So Chromium 61 works? The processes really die? Or is it with C62?
Chromium 61 works for me, but Vivaldi 1.12 with the exact same build does not.
Tell me the VB number and I can check it, but it probably was closed as a duplicate of VB-22444.
VB-30595 is the number that I was given. Could you also check on VB-32327 for me too?
-
@shrinra said in Issue with Tab Hibernation:
VB-30595 is the number that I was given. Could you also check on VB-32327 for me too?
No one had looked VB-30595, I closed as a duplicate of VB-22444 as it really is the same bug. This will increase the number of reports on it and will increase the priority.
VB-32327 was already confirmed twice and is awaiting some dev to work on it. I actually linked it to VB-22444 as it might have some connection.
-