Miscellaneous Chrome memory problems |
|||
Issue descriptionOS: Win7 Miscellaneous memory complaints from comments on my blog: You say you work on builds of Chrome, so I would like you to please fix an issue: -> Chrome runs out of memory on Windows when I have a lot of free memory. Because its tabs allocate too much memory. This is a design flaw. Imagine if you couldn’t open 7 word documents at the same time, because each Word process allocated 12 Gigabytes of Memory and 7 * 12 is too much. They only actually use a few megabytes. You can open 6, but not 7. 7 runs out of memory. Would you accept this? Is it “correct”? Of course not. Here is a link: https://www.google.com/search?q=windows+runs+out+of+memory+but+I+have+plenty+chrome Please fix this issue. Otherwise I curse you to have to wait 45 seconds for no reason due to a design flaw in some other part of your operating system of stack. You don’t want a curse, do you? The fact that you have so much RAM is also the reason for your problem. I have 4 GB of RAM. I should still be able to surf web pages that use a few megabytes only! Please see other people’s perspectives too. 🙂 And remember about the curse. So I hope you will address this issue. Thank you! Best: R.
,
Jul 10 2017
In reply to R Questioner. > Chrome runs out of memory on Windows when I have a lot of free memory. > Because its tabs allocate too much memory. That’s not how memory works. Open chrome://version. Are you on 64bit Chrome? If not, switch to 64bit Chrome. If so, be specific: What happens? How much is “a lot of free memory” and how much has Chrome allocated? How have you configured Windows’ virtual memory settings.
,
Jul 10 2017
>That’s not how memory works Except it IS how memory works because I googled “why is Chrome running out of memory” when I have more than a gigabyte free according to Windows (like, how can you run out of memory, when there is lots and lots of memory free???), and such an answer. Here for example, https://productforums.google.com/forum/#!topic/chrome/Sr1VLDtBSIo you can see someone complain “I’m having a similar issue, but there is no lack of memory. […] RAM usage sits around 80%. I have 16GB of RAM, how does Chrome run out of memory” . That means 20% is available for this person, i.e. 3.2 Gigabytes! How can Chrome run out of RAM when it has 3.2 gigabytes available? Because each tab has overallocated some. That is simply what happened. Each tab receives virtual RAM whether it wants it or not. Chrome is broken. >If not, switch to 64bit Chrome. No, I use a 32-bit laptop with 4 GB of RAM (the limit on it). It should still be supported and if Chrome has a 32-bit version it should work well (but doesn’t). I have no intention to switch to 64-bit Windows so developers can ship a broken browser. >be specific: What happens? How much is “a lot of free memory” I don’t know. I increased the size of my page file and did not produce the error just now. you can reproduce it by reducing the size of your page file. it still uses too much memory.
,
Jul 10 2017
In reply to brucedawson. chrome itself uses too much memory, even when rendering nothing. If I have 200 couple-kilobyte tabs that don’t do much but display a static HTML then what do you think a reasonable amount of RAM usage is for displaying all of them in separate tabs? well let’s see, if we take 400 kilobytes and multiply this by 200 we should get…. If you said “I don’t know – a few gigabytes?” then congratulations – you’re a Chrome developer. easy for you guys, with your 64 gigabytes of ram and complaining about a 1.5 second freeze. meanwhile us poor people can’t even do basic research with a few dozen tabs without your browser freezing and crashing and burning and running out of RAM. anyway just remember that you’re now cursed with 45-second random delays, until you fix it. out of all the issues you’re “working on” this might be the only one there’s a curse attached to you for, so I hope you will keep this in mind as you prioritize your to-dos.
,
Jul 10 2017
In reply to R Questioner. It’s certainly true that many webpages are poorly coded and require far more memory than they should. There are myriad mistakes that lead to this, including poorly-optimized images, bloated JavaScript, and unoptimized markup and CSS. > like, how can you run out of memory, when there is lots and lots of memory free??? The typical explanation is that you’re not running out of memory, you’re running out of contiguous address space: https://textslashplain.com/2016/02/26/out-of-memory-is-a-lie/. That’s why running a 64bit OS is a good idea, even if you only have 4gb of physical memory.
,
Jul 10 2017
In reply to brucedawson. Poloniex.com
,
Jul 10 2017
In reply to Tim Locke. I see that page using 22 MB of RAM. This is less than what Edge uses. On a simple page like this much of the cost is the minimal costs of having a separate process per tab, for security. I frequently use Chrome on a 4 GB machine with a dozen tabs and it runs fine. If you have examples of sites that use too much memory (22 MB doesn’t count) please file bugs on crbug.com, rather than here. Sometimes this represents a Chrome bug, and sometimes a web-page bug.
,
Jul 10 2017
In reply to brucedawson. Is it related or not to memory usage when, on my 4GB system, switching back to a tab I haven’t viewed in a while results in a page reload? Usually it’s switching back to Gmail after reading a series of articles (opening and closing a number of other tabs). Makes sense because Gmail is top of Chrome’s task manager for memory usage (though still “only” 300-odd MB). I’ve not seen that happen on my 8GB machine, but the OSes are also different (Win7 4GB, OSX 8GB).
,
Jul 10 2017
Concrete information that we need in order to be able to help: Screen shot of Chrome's task manager - this will show us how much memory each tab is consuming Screen shot of Windows Task Manager, Performance tab, showing memory details > If I have 200 couple-kilobyte tabs If you have 200 tabs open on a 4 GB machine then it will not work. Sorry. If you have a small or non-existent page file then it will work even less. 4 GB divided by 200 tabs is ~20 MB per tab and I'm afraid that is not enough. In addition, the amount of committed memory will be greater than the amount of memory in use. If your page file is disabled or too small then you will run out of commit before you run out of memory. That is probably your problem. But mostly, if you have 200 tabs open on a 4 GB machine then it will not work. We do have some projects in mind that might handle this scenario however, so watch for improvements. However I'm not sure if you have 200 tabs open or a few dozen tabs so I'm not clear on the order of magnitude of the problem.
,
Jul 11 2017
Hi. I'm from your blog. Thanks for transferring my comments. Firstly I want to reiterate that there is a major curse on you. In this comment I address your responses and questions. Before I do, on your blog you write "We do take memory consumption issues seriously" but your actions speak to the opposite. Let me give you an analogy. Suppose Microsoft said "We do take saving's people's Word documents and keeping them from losing data seriously" but 1) there was no functionality to autosave; 2) there were a function in the production version that had a 1/50,000 chance of crashing Word every second. On average this would cause a crash every 50000 seconds or 13 hours. In addition, suppose that the crashing function first corrupted the word document, and saved the corrupted version. And there is no way to enable autosaving. Would you take their statement that they consider "saving people'sWord documents and keeping them from losing data seriously"? Of course not. Because they show they do not take it seriously. (By Comparison, Gmail drafts and Google Documents takes saving user data seriously.) So, we cannot accept that you take memory issues seriously. It is a lie. If you took them seriously you would not be shipping the browser that people are receiving from you. Simple fact. If you took it seriously you would be running your browser in a VM with between 256 and 4 GB of RAM for your everyday home usage. These are simple facts. Now, your response is wrong and you are wrong, and your curse is 100% active. Let's look at this in a bit more detail. Firstly, let's see what Chrome is apparently able to do just fine: it has no problem buffering and playing a 1-hour youtube in a single tab. This takes maybe a couple of hundred megabytes. Apparently, this model is supported. Now let's look at where it is broken: you state in your comment that you believe I should not be able to open 200 low-weight textual links; for example as a researcher working on learning something new. You apparently accept that "22 megabytes" per "400 kilobyte" page *PLUS* the overallocated RAM, which you've confirmed happens, is an acceptable trade-off. Let's see what factor this is. This is an inflationary factor of 400 KB over the wire exploding (inflating) by 55x. In addition, bear in mind that in most cases I am *actively* attempting to reduce my memory usage by rolling up the tab into just its URL (via the Great Suspender) which is typically less than 256 character (bytes). So you are actually inflating by 22 MB / 256 bytes = 85937x. You are considering using 85,000 times more memory than necessary to let me do my work to be "taking memory consumption seriously." This is an obvious absurdity. Fully rendering a web page and taking a bitmap screenshot of the entire screen would take, at my resolution, less than just 3 MB (24 bits x 1400x900 which is my resolution). As rerending from what has come over the wire typically takes less than 1.3 seconds this is absurd over-kill. Yet you quote a usage that is more than 8x higher (more than 24 megabytes, and in addition you allocate further virtual ram), to be "not enough - not reasonable". For this reason you are cursed to having to stop and wait 45 seconds at random times throughout your browsing. >> If I have 200 couple-kilobyte tabs >If you have 200 tabs open on a 4 GB machine then it will not work. Sorry. If you have a small or non-existent page file then it will work even less. 4 GB divided by 200 tabs is ~20 MB per tab and I'm afraid that is not enough. So you believe that a 1 hour video can be kept in memory, which 'weighs' hundreds of megabytes over the wire, but keeping 200 x 500 kilobytes over the wire, which 'weighs' less than 100 megabytes, is "not enough." You believe that while I should be able to open a single 200-page PDF in a browser, no problem, I should not be able to open 200 links throughout the web, the way researchers typically do. You do not believe in research or progress or advancing the human condition. But you fully believe in hour-long music videos. For this reason you are cursed for 45-second delays. >In addition, the amount of committed memory will be greater than the amount of memory in use. If your page file is disabled or too small then you will run out of commit before you run out of memory. That is probably your problem. Why is the committed memory greater than the amount of memory in use? This is obviously the opposite of being "committed to reducing memory usage." Every single statement you have made in this thread shows that you are committed to using absurd amounts of memory. You have no fundamental understanding of entropy, or basic computer science trade-offs. If Chrome takes 3 seconds to render 1 megabyte that has come over the wire, then the tab should be 3 seconds away from displaying it. But you do NOT choose those 3 seconds: you choose the 50 megabytes to which you inflate it, over the 3 seconds. Because you are lying when you say you are committed to reducing memory usage. You are not. It is a simple lie, the same as if Microsoft Word crashed and corrupted the saved file, and had no option to autosave. Then if they said they are committed to saving user data, they would be lying. The source of your lie is that your build system requires you to have 64 Gigabytes of RAM. So you don't care about billions of people who do not have access to that. There are over 1 billion people running a PC with less than 64 gigabytes of RAM, and you are committed to betraying all of them by failing to understand and implement basic computer science principles of entropy and speed/space trade-offs that you should have learned in the first year of your computer science degree. For this reason you are cursed. Until you fix this correctly you are cursed to experiencing random hangs of 45 seconds during which you can do nothing at all. This is the curse I have placed upon you. Fix it.
,
Jul 11 2017
> Why is the committed memory greater than the amount of memory in use? This is how Windows works. Here is an example. When a thread is created it is given a stack. Some memory is reserved (committed) for this stack. Typically this is one MB. This comes out of the OS commit charge, even though it would be unusual to actually ever use all that memory. That is an example of how *all* programs running on Windows will necessarily use more commit than physical memory. Therefore, if you have a small or non-existent paging file then you will run out of memory when there is still some available. There are certainly other examples. Reducing the amount of memory committed is possible but it increases the risk of stack-overflow crashes and consumes valuable developer resources which are better spent elsewhere. You are correct that a 400 KB over-the-wire page may end up consuming ~22 MB of RAM. You will also see that this inflation amount is pretty common amongst web browsers. You are correct that we could store the 400 KB of over-the-wire data and then inflate it on-demand. However this comes with significant complexity and tradeoffs. Many web pages do not tolerate being torn down and then recreated well. Many users do not want to wait three seconds for a page that they previously loaded to reappear. Saving memory is important, but it is not the only thing. As I said, we are working on ways of supporting those users who like to have hundreds of tabs open. We recognize that that is a valid use-case. However, implementing this without breaking the web is tricky and it will take a while. There are many complex tradeoffs (responsiveness, network reliability, battery life, stability, reliability, security, and yes, memory) that we are balancing, while also adding new features. You have suggested (sort of) design changes that could improve the one thing that you care about, but that does not mean that your design changes are the best thing for Chrome overall. > The source of your lie is that your build system requires you to have 64 Gigabytes of RAM. > So you don't care about billions of people who do not have access to that. The second statement does not follow from the first, and the second statement is absolutely not true. > You have no fundamental understanding of entropy, or basic computer science trade-offs. You are welcome to believe that. However, insulting those who choose to listen to your complaints does not increase the odds that your complaints will be addressed.
,
Jul 11 2017
>However this comes with significant complexity and tradeoffs
oh, I'm sorry, I thought I was talking with Google here. I never realized simplifying it to the level where a wordpress plugin developer whose functions usually look like this
addmultipletimes(numbertodo, texttoinclude) // add an element to the page a number of times
{
if(numbertodo == 1){
addtext(texttoinclude);
}
if(numbertodo == 2){
addtext(texttoinclude);
addtext(texttoinclude);
}
if(numbertodo == 3){
addtext(texttoinclude);
addtext(texttoinclude);
addtext(texttoinclude);
}
// if we have more than 3 we have to add the first 3 then call ourselves again. this is 'recursive' solution.
// it can probbaly be refactored into a for or while loop but there is just a lot more priorities and it is working except > 100
if (numbertodo > 3) {
//recursive solution
addmultipletimes(3, textttoinclude) //first add 3
addmultipletimes(numbertodo - 3) //add remaining text
}
I will say that having to learn something new like a for or while loop just to reduce the size of the call stack is kind of beyond this programmer's ability, it works, and anyway if most users are adding the text only 1, 2 or 3 times then that solution works fine. There are always tradeoffs!!!!!!!!! !!!!11111111oneoneone
anyway I claimed above that you are an enemy to research, progress, advancing the human condition, which you have just confirmed.
Hour-long music videos in YouTube play just fine for me by the way.
anyway I don't care if you feel insulted. you have a curse on you until you fix it. you're able to fix it. do it. I'm not going to argue with you. you're google. go buy a whiteboard and solve it. cursed cursed cursed until you do.
by teh way my loops crash whenever i try to do anything more than a few thousand times but upgrading to 64 gigabytes of ram is fix problem. so people complaining just have wrong priorities.
our loops are important to us and we're working on it. anyway php might fix it in the future so that the tail recursion does not make the stack hundreds of thousands deep. we're working on it.
just use smaller loops. we have a lot more important priorities. but this is definitely one of them. (even though it's not.)
/s
Do it. you understand the solutions. you're google. solve them.
anyway I'm not going to argue with you any more. you're cursed until you solve it and this is the end of our interaction.
,
Jul 12 2017
I applaud Bruce's patience for attempting to reply here, and for transcribing this. All that said, the original conversation here is more in the nature of a rant than a bug report, and I don't see anything actionable that isn't captured on other bugs. The hostile attitude on display also torpedoes any chance that we're going to take action on this.
,
Jul 13 2017
#10 and #12: We expect all participants on Chromium's bug tracker to follow Chromium's code of conduct - https://www.chromium.org/conduct. At a high-level, the expectation is that discussion is respectful and constructive. Your comments do not match those expectations, as they include a number of personal attacks as well as some intimidating aspects. If you engage in the future, please be sure to maintain a more civil tone.
,
Jul 13 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by brucedaw...@chromium.org
, Jul 10 2017