Showing the changes to scripts/developer/debugging/scriptMemoryReport.js (1 of 11 files). Show all
Unified · Split
| @@ -15,11 +15,21 @@ · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | var memoryStatisticsIntervalHandle = Script.setInterval(function () { |
| 17 | 17 | 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 | + } | |
| 23 | 33 | }, 5000); |
| 24 | 34 | |
| 25 | 35 | Script.scriptEnding.connect(function () { |