请教一下谷歌浏览器内存查看的问题

lvding89 2017-08-16 11:08:22
最近接手了一个大屏幕数据轮播维护的工作
以前关于内存优化一直没有接触过
客户说页面3小时左右会崩溃
设定自动刷新页面有时也会出现这种问题
打开谷歌浏览器的资源管理器
有个共享内存 有个专用内存 有个js使用内存 请问分别代表什么 刷新之后 js使用内存会清理 但是共享和专用并不会清理 有没有什么优化的方法?
另外问一下 用settimeout做计时器刷新页面 和用全局变量做计时器刷新页面 哪个好一点?
...全文
380 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cheery_an 2017-08-17
  • 打赏
  • 举报
回复
如果是新版的chrome,调试工具栏上有一个专门的memory功能块。
cheery_an 2017-08-17
  • 打赏
  • 举报
回复
另外 Private: Resident memory size that is not shared with any other process. This is the best indicator of browser memory resource usage. Shared: Resident memory size that is currently shared with 2 or more processes. Note: For browsers using multiple processes, if we simply added the shared memory of each individual process, this value would be inflated. Therefore, this value is computed as an approximate value for shared memory in each of the browser's processes. Note also that shared memory varies depending on what other processes are running on the system, and may be difficult to measure reproducibly.
cheery_an 2017-08-17
  • 打赏
  • 举报
回复
你可以看看这个文档 https://developers.google.com/web/tools/chrome-devtools/memory-problems/memory-101 做几次内存比对,看下为什么内存会涨;也可以看看刷新后内存的占用情况。

87,914

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧