Chrome tab suspension - is that feasible?

354 views
Skip to first unread message

Praveen RS

unread,
May 10, 2017, 12:50:38 PM5/10/17
to Chromium-dev
Hi,
There are extensions on the chrome store with the ability to suspend tabs. This could definitely be advantageous for the end user who may find slowness in browsing.
But, i have few basic doubts:
(1) Chrome is designed to have separate sandboxed rendering engine sessions along with a single browser kernel. I assume that all kernel level interactions from the individual rendering engine sessions would go through the browser kernel session. Is that correct?
e.g., accessing a shared windows resource would be done by the browser kernel and not by the individual rendering engine session.

(2) If the above is correct, what would happen to the shared resource if the requested tab is suspended before the acquired shared resource lock is not released?
Would it keep the lock till the tab is closed or bring back from suspension?

(3) My understanding is that the browser kernel is responsible for downloading/buffering content. If a tab is suspended, would it in turn inform the browser kernel to stop/pause the download process?

(4) Can I assume that all operations(apart from downloading) pertaining to a tab performed by the browser kernel would be paused on suspending that tab?

(5) I am curious to know about the various activities performed by the tabs. Example of this could be the CPU utilization, memory utilization, bandwidth consumption etc. by every tab. Since the tab sessions are managed by Browser kernel, is there a way to enumerate these from browser kernel through an independent app without writing an extension?

Thanks,
Praveen RS

Gabriel Charette

unread,
May 11, 2017, 10:30:24 AM5/11/17
to pravee...@gmail.com, Chromium-dev
We have various efforts underway to better control tabs' shared resource usage.

Tab Discarding is one such effort which exists today, it will discard a tab's content from under it (reloads when focused). This is automatically triggered when your machine gets low on memory but can be manually triggered from chrome://discards.

As far as seeing what the various processes are up to you can use chrome://tracing.

If you're interested in the very low-level and are on Windows, you can also try UIforETW.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/2134e3b9-1d22-447f-8815-2136951b3da7%40chromium.org.

Aaron Gable

unread,
May 11, 2017, 3:06:15 PM5/11/17
to pravee...@gmail.com, Chromium-dev
A group of four students I was mentoring recently finished a 9-month-long investigation into the feasibility of serializing the entire state of a render process to disk, and then restoring that process when the user returns to the corresponding tab. Long story short, it is very very hard, and not really worthwhile. I'll have more details when the full report comes out in a few weeks, but some are here inline:

On Wed, May 10, 2017 at 9:51 AM Praveen RS <pravee...@gmail.com> wrote:
Hi,
There are extensions on the chrome store with the ability to suspend tabs. This could definitely be advantageous for the end user who may find slowness in browsing.
But, i have few basic doubts:
(1) Chrome is designed to have separate sandboxed rendering engine sessions along with a single browser kernel. I assume that all kernel level interactions from the individual rendering engine sessions would go through the browser kernel session. Is that correct?
e.g., accessing a shared windows resource would be done by the browser kernel and not by the individual rendering engine session.

We call it the browser process, not the browser kernel to avoid confusion, but basically yes. The sandboxed render processes have a very very limited set of kernel calls they can make. They can't even open file descriptors -- if they want to read a file, the browser process has to open the file descriptor and then pass the open descriptor to the render process over IPC.
 

(2) If the above is correct, what would happen to the shared resource if the requested tab is suspended before the acquired shared resource lock is not released?
Would it keep the lock till the tab is closed or bring back from suspension?

For the most part, it dies. The browser process doesn't trust the render process at all -- if someone were to have a working exploit and take over the render process, the browser process tries to shut it down as soon as it detects that something is wrong. In particular, if the render process unexpectedly closes its half of a shared resource (e.g. because it is being suspended), the browser immediately kills the render process.
 

(3) My understanding is that the browser kernel is responsible for downloading/buffering content. If a tab is suspended, would it in turn inform the browser kernel to stop/pause the download process?

Your understanding is correct. But no, it wouldn't. Instead, the browser would realize that the render process is no longer reading from its side of the asynchronous IPC message pipe, and so stop writing to it.
 

(4) Can I assume that all operations(apart from downloading) pertaining to a tab performed by the browser kernel would be paused on suspending that tab?

Nope. The browser has no inherent ability to understand a suspended render process. It would behave as though that process is simply not responding, or hung for some other reason -- i.e. it would continue doing work, and periodically retry communication with exponential backoff.
 

(5) I am curious to know about the various activities performed by the tabs. Example of this could be the CPU utilization, memory utilization, bandwidth consumption etc. by every tab. Since the tab sessions are managed by Browser kernel, is there a way to enumerate these from browser kernel through an independent app without writing an extension?

As gab mentioned, chrome://tracing is your best window into the performance behavior of tabs, as seen by the browser process.

Praveen RS

unread,
Jul 4, 2017, 12:07:08 AM7/4/17
to Chromium-dev
I am excited to see the task manager feature in chrome. Can I know what APIs used by the task manager to get the utilization of various counters like CPU, memory etc.
Can we use those APIs in our extensions?
Reply all
Reply to author
Forward
0 new messages