Commit b9ba3a7
deps: V8: backport fe81545e6d14
Original commit message:
[api] Adding total allocated bytes in HeapStatistics
This change exposes total allocated bytes in v8::HeapStatistics API by
introducing a new total_allocated_bytes() method that tracks all heap
allocations since an Isolate creation.
The implementation adds:
- uint64_t total_allocated_bytes_ field to HeapStatistics.
- An atomic total allocation counter is stored in the Heap class.
- The counter is incremented whenever a RestLab is called. This approach can overestimate the total allocation for cases where the LAB is not fully used, but the leftover compared to the LAB itself is quite small, so it seems tolerable.
Design doc reference:
https://docs.google.com/document/d/1O4JPsoaxTQsX_7T5Fz4rsGeHMiM16jUrvDuq9FrtbNM
Change-Id: Ic531698aaeb1578f943b7fdd346b9159ffd9b6c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6996467
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dmitry Bezhetskov <dima00782@gmail.com>
Cr-Commit-Position: refs/heads/main@{#103296}
Refs: v8/v8@fe81545
Co-authored-by: Caio Lima <caiolima@igalia.com>
PR-URL: #60429
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>1 parent bf0de92 commit b9ba3a7Copy full SHA for b9ba3a7
File tree
Expand file treeCollapse file tree
8 files changed
+199
-9
lines changedOpen diff view settings
Filter options
- deps/v8
- include
- src
- api
- heap
- test/cctest
Expand file treeCollapse file tree
8 files changed
+199
-9
lines changedOpen diff view settings
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | | - |
| 41 | + |
42 | 42 | |
43 | 43 | |
44 | 44 | |
|
Collapse file
deps/v8/include/v8-statistics.h
Copy file name to clipboardExpand all lines: deps/v8/include/v8-statistics.h+8Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
154 | 154 | |
155 | 155 | |
156 | 156 | |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
157 | 164 | |
158 | 165 | |
159 | 166 | |
| ||
175 | 182 | |
176 | 183 | |
177 | 184 | |
| 185 | + |
178 | 186 | |
179 | 187 | |
180 | 188 | |
|
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6584 | 6584 | |
6585 | 6585 | |
6586 | 6586 | |
6587 | | - |
| 6587 | + |
| 6588 | + |
6588 | 6589 | |
6589 | 6590 | |
6590 | 6591 | |
| ||
10438 | 10439 | |
10439 | 10440 | |
10440 | 10441 | |
| 10442 | + |
10441 | 10443 | |
10442 | 10444 | |
10443 | 10445 | |
|
Collapse file
deps/v8/src/heap/heap-allocator.cc
Copy file name to clipboardExpand all lines: deps/v8/src/heap/heap-allocator.cc+24-7Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
85 | 85 | |
86 | 86 | |
87 | 87 | |
| 88 | + |
88 | 89 | |
89 | 90 | |
90 | | - |
| 91 | + |
| 92 | + |
| 93 | + |
91 | 94 | |
92 | | - |
| 95 | + |
| 96 | + |
| 97 | + |
93 | 98 | |
94 | | - |
| 99 | + |
| 100 | + |
| 101 | + |
95 | 102 | |
96 | | - |
| 103 | + |
| 104 | + |
| 105 | + |
97 | 106 | |
98 | | - |
| 107 | + |
| 108 | + |
| 109 | + |
99 | 110 | |
100 | | - |
101 | | - |
| 111 | + |
| 112 | + |
| 113 | + |
102 | 114 | |
103 | 115 | |
104 | 116 | |
105 | 117 | |
106 | 118 | |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
107 | 124 | |
108 | 125 | |
109 | 126 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
7717 | 7717 | |
7718 | 7718 | |
7719 | 7719 | |
| 7720 | + |
| 7721 | + |
| 7722 | + |
| 7723 | + |
7720 | 7724 | |
7721 | 7725 | |
7722 | 7726 | |
|
Collapse file
+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1707 | 1707 | |
1708 | 1708 | |
1709 | 1709 | |
| 1710 | + |
| 1711 | + |
| 1712 | + |
| 1713 | + |
| 1714 | + |
1710 | 1715 | |
1711 | 1716 | |
1712 | 1717 | |
| ||
2499 | 2504 | |
2500 | 2505 | |
2501 | 2506 | |
| 2507 | + |
| 2508 | + |
2502 | 2509 | |
2503 | 2510 | |
2504 | 2511 | |
|
Collapse file
deps/v8/src/heap/main-allocator.cc
Copy file name to clipboardExpand all lines: deps/v8/src/heap/main-allocator.cc+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
297 | 297 | |
298 | 298 | |
299 | 299 | |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | + |
300 | 306 | |
301 | 307 | |
302 | 308 | |
|
Collapse file
deps/v8/test/cctest/test-api.cc
Copy file name to clipboardExpand all lines: deps/v8/test/cctest/test-api.cc+146Lines changed: 146 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17656 | 17656 | |
17657 | 17657 | |
17658 | 17658 | |
| 17659 | + |
| 17660 | + |
| 17661 | + |
| 17662 | + |
| 17663 | + |
| 17664 | + |
| 17665 | + |
| 17666 | + |
| 17667 | + |
| 17668 | + |
| 17669 | + |
| 17670 | + |
| 17671 | + |
| 17672 | + |
| 17673 | + |
| 17674 | + |
| 17675 | + |
| 17676 | + |
| 17677 | + |
| 17678 | + |
| 17679 | + |
| 17680 | + |
| 17681 | + |
| 17682 | + |
| 17683 | + |
| 17684 | + |
| 17685 | + |
| 17686 | + |
| 17687 | + |
| 17688 | + |
| 17689 | + |
| 17690 | + |
| 17691 | + |
| 17692 | + |
| 17693 | + |
| 17694 | + |
| 17695 | + |
| 17696 | + |
| 17697 | + |
| 17698 | + |
| 17699 | + |
| 17700 | + |
| 17701 | + |
| 17702 | + |
| 17703 | + |
| 17704 | + |
| 17705 | + |
| 17706 | + |
| 17707 | + |
| 17708 | + |
| 17709 | + |
| 17710 | + |
| 17711 | + |
| 17712 | + |
| 17713 | + |
| 17714 | + |
| 17715 | + |
| 17716 | + |
| 17717 | + |
| 17718 | + |
| 17719 | + |
| 17720 | + |
| 17721 | + |
| 17722 | + |
| 17723 | + |
| 17724 | + |
| 17725 | + |
| 17726 | + |
| 17727 | + |
| 17728 | + |
| 17729 | + |
| 17730 | + |
| 17731 | + |
| 17732 | + |
| 17733 | + |
| 17734 | + |
| 17735 | + |
| 17736 | + |
| 17737 | + |
| 17738 | + |
| 17739 | + |
| 17740 | + |
| 17741 | + |
| 17742 | + |
| 17743 | + |
| 17744 | + |
| 17745 | + |
| 17746 | + |
| 17747 | + |
| 17748 | + |
| 17749 | + |
| 17750 | + |
| 17751 | + |
| 17752 | + |
| 17753 | + |
| 17754 | + |
| 17755 | + |
| 17756 | + |
| 17757 | + |
| 17758 | + |
| 17759 | + |
| 17760 | + |
| 17761 | + |
| 17762 | + |
| 17763 | + |
| 17764 | + |
| 17765 | + |
| 17766 | + |
| 17767 | + |
| 17768 | + |
| 17769 | + |
| 17770 | + |
| 17771 | + |
| 17772 | + |
| 17773 | + |
| 17774 | + |
| 17775 | + |
| 17776 | + |
| 17777 | + |
| 17778 | + |
| 17779 | + |
| 17780 | + |
| 17781 | + |
| 17782 | + |
| 17783 | + |
| 17784 | + |
| 17785 | + |
| 17786 | + |
| 17787 | + |
| 17788 | + |
| 17789 | + |
| 17790 | + |
| 17791 | + |
| 17792 | + |
| 17793 | + |
| 17794 | + |
| 17795 | + |
| 17796 | + |
| 17797 | + |
| 17798 | + |
| 17799 | + |
| 17800 | + |
| 17801 | + |
| 17802 | + |
| 17803 | + |
| 17804 | + |
17659 | 17805 | |
17660 | 17806 | |
17661 | 17807 | |
|
0 commit comments