diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index 606b2173..7813d47f 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -2010,7 +2010,6 @@ export class SystemKeywords { let storage = file.indexOf('.xlsx') === -1; let results; let header = [], rows = []; - const minBoot = GBServer.globals.minBoot; let t; let fieldsNames = []; let fieldsSizes = []; diff --git a/src/app.ts b/src/app.ts index 00c5f5df..48bce40e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -59,6 +59,9 @@ import * as winston from 'winston-logs-display'; import { RootData } from './RootData.js'; import { GBSSR } from '../packages/core.gbapp/services/GBSSR.js'; import { Mutex } from 'async-mutex'; +import { setFlagsFromString } from 'v8'; +import { runInNewContext } from 'vm'; + /** * General Bots open-core entry point. @@ -76,7 +79,21 @@ export class GBServer { GBConfigService.init(); const port = GBConfigService.getServerPort(); + setFlagsFromString('--expose_gc'); + + const runGC = () { + setTimeout(function() { + + // Do something here + GBLog.info('Running GC...'); + + const gc = runInNewContext('gc'); // nocommit + gc(); + runGC(); + }, 5* 60 *1000); + } + if (process.env.TEST_SHELL) { GBLog.info(`Running TEST_SHELL: ${process.env.TEST_SHELL}...`);