20 lines
672 B
JavaScript
20 lines
672 B
JavaScript
|
//
|
||
|
// scriptMemoryReport.js
|
||
|
// scripts/developer/debugging
|
||
|
//
|
||
|
// Created by dr Karol Suprynowicz on 2023/04/23
|
||
|
// Copyright 2023 Overte e.V.
|
||
|
//
|
||
|
// Distributed under the Apache License, Version 2.0.
|
||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||
|
// SPDX-License-Identifier: Apache-2.0
|
||
|
//
|
||
|
|
||
|
// A simple script that prints memory usage statistics for a given script engine every 5 seconds
|
||
|
// It can be included for example as a part of default scripts or controller scripts
|
||
|
|
||
|
Script.setInterval(function () {
|
||
|
for (let i = 0; i < 50000; i++) {
|
||
|
let dbgobj = Script.createGarbageCollectorDebuggingObject();
|
||
|
}}, 10);
|