Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the System objects in chrome javascript memory profiler

I'm profiling javascript application using Chrome dev tools.

I see that the only memory area that grows is System objects total.

I wonder how could I understand what causes such behavior as there are no details in the tool showing which system objects got leaked.

I've taken a look at app allocation, but it doesn't change much over time ... When I'm using timeline feature heap grows over 500mb

initial snapshot"

snapshot after multi-hour usage

snapshot after usage of timeline tool

like image 646
Sergey Dryganets Avatar asked May 10 '16 23:05

Sergey Dryganets


People also ask

What is memory profiling in JavaScript?

The profiles view allows you to get a snapshot and compare snapshots of the memory use of your JavaScript code. It also allows you to record allocations along time. In every result view different types of lists are available, but the most relevant ones for our task are the summary list and the comparison list.

How do I view memory snapshot in Chrome?

# Take a snapshot Snapshots are initially stored in the renderer process memory. They are transferred to the DevTools on demand, when you click on the snapshot icon to view it.

Does Chrome have a memory leak?

Google Chrome is one of the popular web browsers and Chrome memory leak is one of the common issues. Today we will talk about this problem on the MiniTool website. If you find there are many tabs of Chrome in Task Manager and Chrome uses much memory, follow these solutions below to easily fix the issue.

How do I check Chrome memory usage?

The Task Manager is a realtime monitor that tells you how much memory a page is currently using. Press Shift+Esc or go to the Chrome main menu and select More tools > Task manager to open the Task Manager. Right-click on the table header of the Task Manager and enable JavaScript memory.


1 Answers

According to the JSHeapSnapshot.js implementation in Chromium, as mentioned in a comment by wOxxOm, a comparison for the a given node distance to 100000000 is performed (distances[ordinal] >= WebInspector.HeapSnapshotCommon.baseSystemDistance, where WebInspector.HeapSnapshotCommon.baseSystemDistance = 100000000) and if passing, the size is accumulated into the System segment of the pie chart.

The commit that last modifies this value mentions,

Currently if a user object is retained by both a system-space object (e.g. a debugger) and another user object, the system object might be shown earlier in the retainers tree. This happens if its distance is smaller than distances of other retaining user objects.

The patch treats links from system-space objects to user objects with less priority, so these links are shown at the bottom of the retainers tree.

Which indicates that system-space objects on the javascript heap are utilized by debuggers and other internals to the browser (V8, WebKit, etc.). They are outside of the direct control of script allocated heap objects.

wOxxOm also mentioned that the name used to be V8 heap. That is, objects that V8 allocates that are out of reach of the executing script.

It's highly likely that running profiling and taking snapshots performs allocations in that category of heap objects as well, causing the pattern you see of building system allocations over time.

like image 150
TylerY86 Avatar answered Oct 13 '22 10:10

TylerY86