📜 ⬆️ ⬇️

Memory consumption in the background

In Chrome, there is such a wonderful thing as applications and extensions. And they can work wonderfully in the background.

Chrome has long overtook firefox in memory consumption under similar conditions, but what I saw last week struck me deeply.

So about the work in the background.
Having visited the chrome: // memory-redirect / page, I found out that Chrome ate a gig of RAM. Okay, I opened a lot of tabs, to hell with it. But besides this, I noticed a strange fact. Some applications, being closed, consumed from 50 to 100 MB of RAM.

')
I decided to follow it up.
The first thing I did was kill all the “heavy” background pages and restart them. The change you can see below. In the process of surfing (but without appealing to applications), these numbers have not changed:


Next, I restarted the browser. When opening the browser, basically all extensions and applications that work in the background consume 10 MB per second from the power of the hare.


This continues until you begin to actively use the application. “Pogonav” the same tweetdeck for ten minutes, I brought the memory consumption to 80 MB. Having closed the application, the consumption of RAM almost did not decrease throughout the day. Although what would he do in the background ?!

The offline Gmail client seems to understand what it does in the background, but again, working in the background before the first access to the application, the memory consumption remains between 15-25 MB, and in the “after closing” mode it is twice as much.

Having submitted the application , I received the answer that, they say, "this is by design". That is, some applications, in particular tweetdeck and gmail, use the background.html page, which loads when the browser starts up and works in the background until you unload it from the background. Read more here and here .

I have a question for all Google Chrome / Chromium users: do you observe such extensions / applications behavior?

UPD: Everything is probably simple. For Chrome apps, you can create a background page where background tasks will be performed - code.google.com/chrome/extensions/background_pages.html When you start the application, it looks like the data is downloaded to js in this page, but not released when the application is closed - it further operates with this data. Thanks, le0pard !

Source: https://habr.com/ru/post/129610/


All Articles