简体   繁体   English

Google Chrome 浏览器是否有内存限制?

[英]Is there any memory limit for Google Chrome browser?

chrome 中单个选项卡的默认内存限制是多少?

It's hard to answer correctly and the answer could be figured out only in benchmarks for particular task with particular build.很难正确回答,答案只能在具有特定构建的特定任务的基准测试中找到。

There are several thing that could allow you to use from 1 to 2 GB of memory:有几件事可以让您使用 1 到 2 GB 的内存:

  • Chrome version: because different V8 engines have different memory limits. Chrome 版本:因为不同的 V8 引擎有不同的内存限制。
  • Chrome platform: 32-bit or 64-bit. Chrome 平台:32 位或 64 位。
  • Operating System itself: chrome could be built with different flags for different platforms.操作系统本身:chrome 可以为不同的平台使用不同的标志构建。
  • Again, Chrome version: there are some discussion on the internet about recompiling chrome with some compilation flags that could allow to use more memory, then chrome developers decide to exclude such flags because of some reasons.同样,Chrome 版本:互联网上有一些关于使用一些编译标志重新编译 chrome 的讨论,这些标志可以允许使用更多内存,然后由于某些原因,chrome 开发人员决定排除这些标志。 Who know — maybe they will include them again or will increase default heap size.谁知道——也许他们会再次包含它们,或者会增加默认堆大小。
  • Video memory: in some cases page's content may require some video memory and, if your video adapter has no sufficient amount, Chrome will take it from general memory, which will increase memory usage for the page.显存:在某些情况下,页面的内容可能需要一些显存,如果您的视频适配器没有足够的内存,Chrome 将从一般内存中获取它,这会增加页面的内存使用量。

Right now, with 64bit Chrome version 47, on Windows 8.1 I can take up to 1.8GB with one tab, then it crashes.现在,使用 64 位 Chrome 版本 47,在 Windows 8.1 上,我最多可以使用一个标签占用 1.8GB,然后崩溃。

Update:更新:

As I can see some magic has happened and limit has changed.正如我所看到的,发生了一些神奇的事情,限制也发生了变化。
For Chrome version 63, on x64 Windows 10 OS, I could allocate up to 3.5 GB memory, parsing a huge JSON string and then displaying it on the page.对于 Chrome 63 版,在 x64 Windows 10 操作系统上,我最多可以分配 3.5 GB 内存,解析一个巨大的 JSON 字符串,然后将其显示在页面上。
The number is taken from Chrome's Task manager and from Process Explorer's Private Bytes metric.该数字取自 Chrome 的任务管理器和 Process Explorer 的Private Bytes指标。

There was some talking about a very similar topic.有人在谈论一个非常相似的话题。 Here 这里

You should try the following:您应该尝试以下操作:

Right click on the Chrome icon and go to properties.右键单击 Chrome 图标并转到属性。 Chrome should be here: Chrome 应该在这里:

"C:\Documents and Settings\%USER%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" 

Where %USER% is your username on your PC, obviously ;)显然,%USER% 是您 PC 上的用户名;)

At the end of the line add --purge-memory-button在行尾添加--purge-memory-button

It should look like this:它应该是这样的:

"C:\Documents and Settings\%USER%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --purge-memory-button 

Now, when Chrome works, press shift+Esc, and now you have a new option, "Purge Memory" which frees up memory.现在,当 Chrome 工作时,按 shift+Esc,现在你有了一个新选项,“清除内存”,它可以释放内存。 The tabs that do not need attention at that particular time will be purged from your RAM.在特定时间不需要注意的选项卡将从您的 RAM 中清除。

You can also add one of these lines:您还可以添加以下行之一:

Never voluntarily relinquish memory永远不要主动放弃记忆

--memory-model=high  

Voluntarily reduce working set when switching tabs切换标签时自动减少工作集

--memory-model=medium 

Voluntarily reduce working set when switching tabs and also when the在切换选项卡时以及当

--memory-model=low 

Browser is not actively being used浏览器没有被积极使用

You can have several lines after the target place "C:\\Documents and Settings\\%USER%\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe"您可以在目标位置"C:\\Documents and Settings\\%USER%\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe"

Let's say we wanna use the "Purge memory" line and the "Low memory model" line.假设我们要使用“清除内存”行和“低内存模型”行。 It would look like this:它看起来像这样:

"C:\Documents and Settings\%USER%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --purge-memory-button --memory-model=low 

You can have a perfect answer once you benchmark on a specific platform with a specific version.一旦您在具有特定版本的特定平台上进行基准测试,您就可以获得完美的答案。 The outcome will only be applicable to that platform and chrome version you experimented because there is so many factors that may have a different effect in results including,结果仅适用于您试验的该平台和 chrome 版本,因为有很多因素可能会对结果产生不同的影响,包括,

  1. The Chrome Version may have different v8 engines and not all v8 engines have the same memory limits. Chrome 版本可能有不同的 v8 引擎,并不是所有的 v8 引擎都有相同的内存限制。 Also, the 32 bit and 64-bit architecture come into picture when we benchmark the chrome.此外,当我们对 chrome 进行基准测试时,32 位和 64 位架构就会出现。 The default heap size may varies from v8 version to version.默认堆大小可能因 v8 版本而异。

  2. The system configuration on which you run the chrome.运行 chrome 的系统配置。 chrome requires the graphics memory/video memory and when you don't have that, It will use internal memory resulting in more memory usage. chrome 需要图形内存/视频内存,如果没有,它将使用内部内存,从而导致更多内存使用。

  3. It's also related to process itself, every thread requires some memory for bookkeeping , notably its stack.它还与进程本身有关,每个线程都需要一些内存用于bookkeeping ,特别是它的堆栈。 32-bit processes can only address 4 GB of memory. 32 位进程只能寻址 4 GB 的内存。 64-bit processes don't have problems with address space, but rather with the actual allocations. 64 位进程没有地址空间问题,而是实际分配问题。 However, programs should not approach any such limit or need to worry about it and the same applies to chrome as well.但是,程序不应接近任何此类限制或需要担心它,这同样适用于 chrome。

I tried once to export and print the database from PHPMyAdmin from chrome.我曾尝试从 chrome 从 PHPMyAdmin 导出和打印数据库。 It had 1.22GB of size in DB and chrome crashed.它在数据库中有 1.22GB 的大小,并且 chrome 崩溃了。 Same thing I performed to file export and magically it worked fine.我对文件导出所做的同样的事情,神奇的是它工作正常。

About the v8 engine, it has 512MB memory limit on 32bit system and 1434MB(1.4 GB) on 64bit system.关于 v8 引擎,它在 32 位系统上有 512MB 的内存限制,在 64 位系统上有 1434MB(1.4 GB)的内存限制。 The chrome has v8 it's heart, this is a major factor affecting the memory limit. chrome有v8它的心脏,这是影响内存限制的主要因素。

I was able to increase the memory limit for my nw.js (chrome) based destkop app by passing following command line options:我能提高我的内存限制nw.js通过将以下命令行选项(铬)基于destkop应用:

Node.js: node --max_old_space_size=12288 script.js
Google Chrome: chrome.exe --js-flags="--max_old_space_size=12288"
NW.js: add "js-flags": "--max_old_space_size=12288" to the package.json.

Adjust 12288 (12GB) to suit your needs调整 12288 (12GB) 以满足您的需求

if you're running 32-bit Chrome, you can't allocate more than 2 GB, because that's the process limit for a 32-bit Windows process.如果您运行的是 32 位 Chrome,则不能分配超过 2 GB,因为这是 32 位 Windows 进程的进程限制。 for 64bit chrome there is 4gb limit.对于 64 位 chrome,有 4GB 的限制。 Chrome doesn't allow allocations over 4Gb Chrome 不允许分配超过 4Gb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 密码存储在谷歌浏览器的浏览器内存中 - Password stored in google chrome's browser memory 在 Chrome 浏览器中使用 indexedDB 时有大小限制吗? - is there any size limit when using indexedDB in chrome browser? 是否有任何Cookie可以指示用户是否已登录Google chrome浏览器? - Are there any cookies that indicate if a user has signed in to the Google chrome browser? 谷歌浏览器崩溃内存泄漏或任何渲染问题 - Google Chrome Crashes Memory leak or Any rendering issue 谷歌浏览器录屏 - Screen Recording of Google Chrome Browser Chrome浏览器中的Google Analytics(分析)错误 - Google Analytics Error in Chrome Browser Javascript在Google Chrome浏览器中不起作用 - Javascript not working in Google Chrome Browser 谷歌浏览器和(缓存或内存泄漏) - Google Chrome and (cache or memory leaks) cookie 浏览器中的过期日期是否有任何限制? - Is there any limit on an expired date in the cookie browser? 有什么方法可以使用 Android 中的 JavaScript 或 Python 将用户从 Instagram 等应用内浏览器重定向到 Google Chrome 浏览器? - Is there any way of redirecting user from In-app browser like Instagram to Google Chrome browser using JavaScript or Python in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM