Answer the question
In order to leave comments, you need to log in
Why does the browser need so much memory?
For a long time, people have been complaining about the consumption of incredible amounts of RAM by browsers, they have even stopped complaining because they have become boring. But the question haunts me: what do they store there in such quantities? My Chrome sometimes managed to eat up 200MB per tab - it's just an amazing amount even if you imagine a dozen really large pictures and a lot of text in js css html. Maybe someone knows?
Answer the question
In order to leave comments, you need to log in
Let's take a 1000×1000 image. She alone in the unpacked form notices 4 megabytes. But she may not be alone on the page. Let's take jQuery (without plugins), it will only create a bunch of closures and arrays during loading, which will take up memory. But people also plug in all sorts of plug-ins so that it doesn’t seem small. Then, during HTML parsing, you need to allocate memory for the DOM. The W3C tirelessly invents tag attributes and css properties every day, and you need to allocate memory for each.
Also, the resources of the previous page can be stored in memory for quick response of the “back” button.
Javascript code can store data in arrays/variables in the global scope, and they will not be released until the page is closed or reloaded.
Farther. If flash is not prohibited in your browser, there are probably 1-2 banners on the page and maybe some other invisible flash components. They require the creation of threads and memory for them to store resources and all sorts of rubbish.
Even further. Surely there are Like/+1 buttons on the page, login through social networks and other evil spirits. They are. as a rule, they create a separate iframe, and in especially neglected cases, load scripts, jQuery with 10 plugins and CSS into it. That is, each such button becomes comparable in terms of resource costs to a regular web page.
Move on. Surely the author has extensions in Chrome? Each extension has its own DOM and JS context, that is, it corresponds to an open web page. maybe the author has firefox with firebug? Togazh memory in general will leave unmeasured.
We go even further. If the author has a YouTube tab open, the video is probably cached in memory for quick access.
Now let's look at the Chrome developers at Google. Tired of dealing with crooked and buggy libraries, they approached the solution of the problem radically - they smashed the browser, tabs and plugins into separate processes. Needless to say, in terms of performance, this does not give an increase at all. Also. the authors of Chrome do not hesitate to add libraries like ICU.dll weighing 11 megabytes to it, solely in order to correctly sort some unnecessary Hanoi writing. Apparently, Google employees have computers with so much memory that 11 megabytes means
nothing to them.
By the way, in Chrome it is convenient to see how much memory a particular page or extension takes (Shift + Esc). For example, by adding a SCRIPT tag to an HTML page, we see how memory consumption jumps from 4 to 11 MB (the v8 was loaded).
But all this, as you might guess, is by no means the limit for modern school developers. New JS frameworks, new HTML 5/CSS3 properties and other joys are still ahead of us.
And, if the author fell for the promises of marketers and bought a 64-bit processor, then programs begin to consume about 2 times more memory. That is, when buying such a processor, you should immediately buy 2 times more memory than would be enough on a 32-bit system.
and I, while the memory is cheap, put 16 GB and don’t worry) I don’t even want to brag, I advise everyone just ...
One of the main problems is the DOM and rendering. Due to current CSS specifications, modern browsers have to create a huge amount of synchronization objects for the DOM element and the graphical representation. this can be especially evident with a large use of inline blocks and tables.
so, for example, on large pages such as wikipedia, this can even lead to lags when scrolling through certain places on the page.
So much memory is eaten up by leaks in js scripts.
Even if the site has perfect code, it is not guaranteed that it will work stably with your extensions.
How do you like this picture, facebook tab over 700Mb. It also failed to win. So it's time to just accept and wait for the denouement.
habrahabr.ru/qa/16773/
Chrome is multi-process.
Open the Chrome Task Manager Shift+Esc and see which process is using a lot of memory. And take action accordingly. If this is some kind of extension, then delete it. If it is, for example, a flash plugin, then go to the plugins page and disable one of the flash plugins (there are usually two of them).
Because it "caches" Facebook (and other applications and their data, Google spreadsheets, etc.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question