History

Added script value and script value proxy counters

ksuprynowicz committed 3 years ago

Commit cd110661 parent 785867311 files · +85 −12Browse files

Showing the changes to scripts/developer/debugging/scriptMemoryReport.js (1 of 11 files). Show all

Unified · Split

scripts/developer/debugging/scriptMemoryReport.js+15−5
@@ -15,11 +15,21 @@ · 14 unmodified lines
1515
1616 var memoryStatisticsIntervalHandle = Script.setInterval(function () {
1717 statistics = Script.getMemoryUsageStatistics();
18− print("Script memory usage: Total heap size: " + statistics.totalHeapSize
19− + " usedHeapSize: " + statistics.usedHeapSize
20− + " totalAvailableSize: " + statistics.totalAvailableSize
21− + " totalGlobalHandlesSize: " + statistics.totalGlobalHandlesSize
22− + " usedGlobalHandlesSize: " + statistics.usedGlobalHandlesSize);
18+ if (statistics.scriptValueCount != null) {
19+ print("Script memory usage: Total heap size: " + statistics.totalHeapSize
20+ + " usedHeapSize: " + statistics.usedHeapSize
21+ + " totalAvailableSize: " + statistics.totalAvailableSize
22+ + " totalGlobalHandlesSize: " + statistics.totalGlobalHandlesSize
23+ + " usedGlobalHandlesSize: " + statistics.usedGlobalHandlesSize
24+ + " scriptValueCount: " + statistics.scriptValueCount
25+ + " scriptValueProxyCount: " + statistics.scriptValueProxyCount);
26+ } else {
27+ print("Script memory usage: Total heap size: " + statistics.totalHeapSize
28+ + " usedHeapSize: " + statistics.usedHeapSize
29+ + " totalAvailableSize: " + statistics.totalAvailableSize
30+ + " totalGlobalHandlesSize: " + statistics.totalGlobalHandlesSize
31+ + " usedGlobalHandlesSize: " + statistics.usedGlobalHandlesSize);
32+ }
2333 }, 5000);
2434
2535 Script.scriptEnding.connect(function () {