JS Heap 推荐内存大小
JS Heap recommended memory size
chrome 内存配置文件中的堆大小是否有任何限制?
理论上,内存限制(不是 LocalStorage,而是实际内存)是无限的,仅受系统 RAM 数量的限制。实际上,大多数 Web 浏览器都会对每个 window 设置一个限制(例如,200MB)。有时,该限制可由用户自定义。此外,操作系统可以限制应用程序使用的内存量。
注意:这是一个 Chrome 唯一的答案,请参阅下面的原因。
你应该看看 Chrome Dev Tools 中的 window.performance.memory
,有一个 jsHeapSizeLimit
属性。
但是,我不确定这将是任何内存分析 y 轴上的最大值
您可以在 MDN 上找到更多信息:https://developer.mozilla.org/en-US/docs/Web/API/Window/performance
performance.memory :
A non-standard extension added in Chrome.
在 MDN 中链接(不再):https://webplatform.github.io/docs/apis/timing/properties/memory/
performance.memory :
Note: This property is read-only.
console.log(performance.memory)
// Would show, for example
//{
// jsHeapSizeLimit: 767557632,
// totalJSHeapSize: 58054528,
// usedJSHeapSize: 42930044
//}
Notes
usedJsHeapSize is the total amount of memory being used by JS objects including V8 internal objects, totalJsHeapSize is current size of the JS heap including free space not occupied by any JS objects. This means that usedJsHeapSize can not be greater than totalJsHeapSize. Note that it is not necessarily that there has ever been totalJsHeapSize of alive JS objects.
请参阅 WebKit Patch 了解如何显示量化值。这些测试尤其有助于解释其工作原理。
请注意,值没有单位表示,因为没有单位。这是因为 webkit 不想暴露可用内存大小等系统信息。它仅提供一种比较内存使用情况的方法(例如,在网站的两个不同版本之间)。
chrome 内存配置文件中的堆大小是否有任何限制?
理论上,内存限制(不是 LocalStorage,而是实际内存)是无限的,仅受系统 RAM 数量的限制。实际上,大多数 Web 浏览器都会对每个 window 设置一个限制(例如,200MB)。有时,该限制可由用户自定义。此外,操作系统可以限制应用程序使用的内存量。
注意:这是一个 Chrome 唯一的答案,请参阅下面的原因。
你应该看看 Chrome Dev Tools 中的 window.performance.memory
,有一个 jsHeapSizeLimit
属性。
但是,我不确定这将是任何内存分析 y 轴上的最大值
您可以在 MDN 上找到更多信息:https://developer.mozilla.org/en-US/docs/Web/API/Window/performance
performance.memory :
A non-standard extension added in Chrome.
在 MDN 中链接(不再):https://webplatform.github.io/docs/apis/timing/properties/memory/
performance.memory :
Note: This property is read-only.
console.log(performance.memory) // Would show, for example //{ // jsHeapSizeLimit: 767557632, // totalJSHeapSize: 58054528, // usedJSHeapSize: 42930044 //}
Notes
usedJsHeapSize is the total amount of memory being used by JS objects including V8 internal objects, totalJsHeapSize is current size of the JS heap including free space not occupied by any JS objects. This means that usedJsHeapSize can not be greater than totalJsHeapSize. Note that it is not necessarily that there has ever been totalJsHeapSize of alive JS objects.
请参阅 WebKit Patch 了解如何显示量化值。这些测试尤其有助于解释其工作原理。
请注意,值没有单位表示,因为没有单位。这是因为 webkit 不想暴露可用内存大小等系统信息。它仅提供一种比较内存使用情况的方法(例如,在网站的两个不同版本之间)。