What at work eats up the most memory and processor resources? As it turned out - the browser. And in the era of multitasking and browser operating systems, it is already sad ... What to do and how to be?
The idea was long nurtured, but finally decided to voice.
After a lot of intuitive comprehension and understanding that you need to watch what is really going on my typewriter, I started with a simple one - I looked at how much Windows 7 eats after starting FAR, Firefox and a couple of small applications from the control panel.
')
Task-manager said: “Allocated 1070/2038” (meters).
Already pop - on my second laptop of all gig ... That is, after loading it will eat everything, but I also need to work, gentlemen. I remember in the good old days of Winda number 4 drank 300-400 meters, no more, and then swearing, but here ... Although we haven’t done anything yet! And the memory to hell ...
Okay, for now let's leave the original picture. Let's see how I work - and this is obtained from 10-15 tabs in the browser, 3-4 ssh, a pair of FARS, a couple of gvim. WinAmp, Skype - well, like everything.
Skype eats 35-45 meters - we will take into account that there is a lot.
FARs and ssh: I have one FAR eating 1.7 mega. You can still ignore them - they still can not be cut in any way. And we need to change something, because it is impossible to live like this. VIM is also not optimized - other editors eat so much that mom doesn’t grieve.
Winamp - skip, use not often, especially at work. Not critical. Either it hangs in a swap - then it doesn't interfere, or it is active - but then I listen to it and no longer react to anything.
Firefox remains. Yes, even with 15 tabs.
And each taba works independently of the other, regardless of whether I see it or not. An example is very simple from the life - 3 tabs with video were opened (2 episodes of one film, and another trailer). All stopped. And then the system falls.
Ok, we are overloaded, the session is being restored ... Hooray, we have 3 parallel videos in parallel !!! I have two ears, and three videos in parallel to me certainly will not fit. Whoever invented it, or rather, just had a name, is now irrelevant. This is one my real example.
And now let's look further.
On the page there is a lot of animation in the form of an advertisement (gifs), another bunch of flash - and this viper, excuse me, there are no other words - the percent is eating and the memory is not measured.
Now we look: for example, on our page roughly 5 banners.
Multiply by my 15 tabs.
Already 75. And all work at the same time .
And I look only at one. Well, all right, taking into account everything, I look at all five on one page at a time. Why should I twist, animate, voice all the other 70 pieces?
I used to just turn off the flash. But sometimes it is necessary - you turn it on - you have it in the face ... The computer hangs from overload due to an unnecessary swap, calculations, etc. Yes, I know, there are some plugins that include flash on click on a particular chip. But we want to live in such a way that, in the first place, we would be shown only what we see and do not cheat behind our backs, and, secondly, God forbid, also click on each flash drive to turn it on to see uncomfortable and stupid.
From all of the above, the conclusion is simple - the needr should show only what it can actually see - that is, what is on the screen . The fact that behind the screen - he does not need. There is no need to wipe processor resources, memory and disk operations - and there are a lot of them disastrous with a lack of memory, if a lot of flash drives compete for it - this is a pure swap in a cycle until the machine is rebooted. I exaggerate a little, but in the first KDE (it was a long time ago) this is exactly how it worked - the car did not react to anything - it only read and wrote to the disk - the RESET button saved. Really back to the same time?
At school I did not see the company yet - I wrote the code on a programmable calculator, on our Electronics-MK61. So really, my laptop now sometimes slows down more than a calculator.
How to solve?
First, I recall with joy the mode of early communicators - the freeze mode . Why not use it just for invisible tabs?
It's obvious - well, I can not watch the video on the taba if it is hidden. It is necessary to slow down the process and not to float the brain, neither me nor the computer.
Advertising? So the same animated gifs are zero. And flash there too.
There is also a half-way option - most browsers have a “restore session” counter - with a large number of open tabs, they cannot load them all in parallel, because you don’t need all 15 of them in one second? So why not, for example, make it so that the tab (title) is displayed, and the content is not poked yet — not? Those. first of all we pull the active tab, and then, if there is time and an empty traffic window - we pull the rest in the background, but without interfering with the active tab, that is, on-demand .
I think that at least 30% of the speed we will win.
This is simply from the experience of opening-closing pages, etc., I did not write the code for optimization, because then I wouldn’t give out ideas, but a ready-made solution.
I wonder, maybe I am already repeating the beaten paths, but I have not found them in the wilds of the web, and then who can tell me how to deal with this?
And if no one thought about it - would the developers think about it?
Nevertheless, I offer these thoughts to your judgment.
Ps. Yes, you can still turn off unnecessary services - another way to save, but unused services and so hang in the list of "on demand". Another bunch of external software put their memory bites - but this is a separate conversation.