久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='q8jpF'><tr id='q8jpF'><dt id='q8jpF'><q id='q8jpF'><span id='q8jpF'><b id='q8jpF'><form id='q8jpF'><ins id='q8jpF'></ins><ul id='q8jpF'></ul><sub id='q8jpF'></sub></form><legend id='q8jpF'></legend><bdo id='q8jpF'><pre id='q8jpF'><center id='q8jpF'></center></pre></bdo></b><th id='q8jpF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='q8jpF'><tfoot id='q8jpF'></tfoot><dl id='q8jpF'><fieldset id='q8jpF'></fieldset></dl></div>
    <legend id='q8jpF'><style id='q8jpF'><dir id='q8jpF'><q id='q8jpF'></q></dir></style></legend>
      • <bdo id='q8jpF'></bdo><ul id='q8jpF'></ul>

      <small id='q8jpF'></small><noframes id='q8jpF'>

      <tfoot id='q8jpF'></tfoot>

      如何檢測在 JavaScript 中觸發垃圾收集的內存分配

      How to detect the memory allocations that are triggering garbage collection in JavaScript?(如何檢測在 JavaScript 中觸發垃圾收集的內存分配?)
        <bdo id='lyeqx'></bdo><ul id='lyeqx'></ul>
      • <tfoot id='lyeqx'></tfoot>

            <tbody id='lyeqx'></tbody>
          <legend id='lyeqx'><style id='lyeqx'><dir id='lyeqx'><q id='lyeqx'></q></dir></style></legend>
          <i id='lyeqx'><tr id='lyeqx'><dt id='lyeqx'><q id='lyeqx'><span id='lyeqx'><b id='lyeqx'><form id='lyeqx'><ins id='lyeqx'></ins><ul id='lyeqx'></ul><sub id='lyeqx'></sub></form><legend id='lyeqx'></legend><bdo id='lyeqx'><pre id='lyeqx'><center id='lyeqx'></center></pre></bdo></b><th id='lyeqx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lyeqx'><tfoot id='lyeqx'></tfoot><dl id='lyeqx'><fieldset id='lyeqx'></fieldset></dl></div>
        • <small id='lyeqx'></small><noframes id='lyeqx'>

                本文介紹了如何檢測在 JavaScript 中觸發垃圾收集的內存分配?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                在尋找 JavaScript 庫(鉚釘)中的性能問題時,我發現垃圾收集在一次運行中發生了 3 到 4 次,占用了大約 15% 的執行時間(使用 Chrome DevTools JS Profile).

                While looking for performance issues in a JavaScript library (rivets), i found that garbage collection occurs three to four times in a run, taking ~15% of execution time (using Chrome DevTools JS Profile).

                由于垃圾回收的原因,至少有 30 個地方創建了臨時函數/對象作為潛在候選對象.

                There are at least 30 places where temporary functions / objects are created being potential candidates for the reason of the garbage collection.

                我想知道是否有辦法找到負責分配被垃圾回收的內存的函數,這樣我就可以專注于我的性能調整.

                I'd like to know if there's a way to find what functions are responsible for the allocation of the memory being garbage collected, so i can focus my performance tuning.

                我記錄了堆分配時間線,但它沒有區分被垃圾收集的內存并且仍然持有引用(沒有像 DevTools 中指出的灰色條 doc)

                I recorded Heap Allocation TimeLine but it does not differentiate memory that was garbage collected and that still holds a reference (there's no gray bar as pointed in DevTools doc)

                還沒有運氣記錄堆分配配置文件.

                Also recorded Heap Allocation Profile without luck.

                推薦答案

                DevToolsProfiles 選項卡中選擇 Record Heap Allocation.包裝 javascript 應在對 setTimeout() 的調用中進行評估,持續時間設置為足夠的時間,以便在函數傳遞給 之前單擊 Start>setTimeout 被調用;例如

                At Profiles tab at DevTools select Record Heap Allocation. Wrap javascript which should be evaluated within a call to setTimeout() with a duration set to enough time to click Start before function passed to setTimeout is called; for example

                <!DOCTYPE html>
                <html>
                <head>
                  <script>
                    t = 5;
                    setTimeout(function() {
                      (function test1() {
                        var a = 123;
                        function abc() {
                          return a
                        }
                        abc();
                      }());
                    }, 10000)
                  </script>
                </head>
                <body></body>
                </html>
                

                setTimeout 被稱為藍條時,可能會在時間軸上出現一個灰條.單擊 Ctr+E 停止記錄堆配置文件.

                When setTimeout is called a blue bar, possibly followed by a gray bar should appear at timeline. Click Ctr+E to stop recording heap profile.

                在時間線圖中選擇藍色或灰色條.在默認選項為 Summary 的下拉菜單中選擇 Containment.選擇

                Select blue or gray bar at timeline graph. Select Containment at dropdown menu where default option is Summary. Select

                [1] :: (GC roots) @n
                

                其中 n 是一個數字.

                通過單擊[1] :: (GC 根) 左側的三角形來展開選擇.選擇[1] :: (GC root)的一個元素,查看顯示的DistanceShallow SizeRetained Size 用于選擇的列.

                Expand the selection by clicking triangle to left of [1] :: (GC roots). Select an element of [1] :: (GC roots), review the displayed Distance, Shallow Size, and Retained Size columns for the selection.

                要查看特定功能,請滾動到

                To check specific functions, scroll to

                [2] :: (External strings) @n
                

                到應該列出全局變量和函數調用的位置;例如,"t""setTimeout" 來自 javascrip.檢查相應的 DistanceShallow SizeRetained Size 列以進行選擇.

                to where global variables and function calls should be listed; i.e.g., "t" and "setTimeout" from above javascrip. Check corresponding Distance, Shallow Size, and Retained Size columns for the selection.

                這篇關于如何檢測在 JavaScript 中觸發垃圾收集的內存分配?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)

                <tfoot id='32dgY'></tfoot>

                  <tbody id='32dgY'></tbody>
                  <bdo id='32dgY'></bdo><ul id='32dgY'></ul>

                  • <legend id='32dgY'><style id='32dgY'><dir id='32dgY'><q id='32dgY'></q></dir></style></legend>
                    1. <small id='32dgY'></small><noframes id='32dgY'>

                      <i id='32dgY'><tr id='32dgY'><dt id='32dgY'><q id='32dgY'><span id='32dgY'><b id='32dgY'><form id='32dgY'><ins id='32dgY'></ins><ul id='32dgY'></ul><sub id='32dgY'></sub></form><legend id='32dgY'></legend><bdo id='32dgY'><pre id='32dgY'><center id='32dgY'></center></pre></bdo></b><th id='32dgY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='32dgY'><tfoot id='32dgY'></tfoot><dl id='32dgY'><fieldset id='32dgY'></fieldset></dl></div>

                          主站蜘蛛池模板: 欧美日韩一卡二卡 | 亚洲精选一区二区 | www.久久久 | 人人干人人玩 | 成人免费一级视频 | 不卡在线视频 | 国产成人免费视频 | 欧美在线视频二区 | 亚洲福利视频网 | 亚洲国产精品一区二区久久 | 日韩精品一区二区三区高清免费 | 日韩视频一级 | 精品中文字幕视频 | 国产精品久久二区 | 在线精品国产 | 伊人国产精品 | 真人毛片 | 日韩欧美精品在线 | 97色在线观看免费视频 | 国内自拍真实伦在线观看 | 91综合网 | 久久久久亚洲 | 日韩欧美视频免费在线观看 | 精品自拍视频在线观看 | 国产 亚洲 网红 主播 | 午夜免费网站 | 天天操天天舔 | 亚洲精品一区二区 | 蜜桃视频麻豆 | 久久久国产一区二区三区 | 伊人网综合 | 日韩看片 | 天天玩天天干天天操 | 久久99精品久久久久久 | 伊人精品一区二区三区 | 日韩高清黄色 | 欧美视频二区 | 免费精品 | 红桃视频一区二区三区免费 | 久久精品免费一区二区 | 亚洲永久 |