Web: force gc in server.js
This commit is contained in:
parent
699c5f7af4
commit
b449dcf655
|
@ -3,6 +3,7 @@ const path = require('path');
|
||||||
const yargs = require('yargs/yargs');
|
const yargs = require('yargs/yargs');
|
||||||
const { hideBin } = require('yargs/helpers');
|
const { hideBin } = require('yargs/helpers');
|
||||||
const koffi = require('koffi');
|
const koffi = require('koffi');
|
||||||
|
require('expose-gc');
|
||||||
|
|
||||||
// Parse command line arguments
|
// Parse command line arguments
|
||||||
const argv = yargs(hideBin(process.argv))
|
const argv = yargs(hideBin(process.argv))
|
||||||
|
@ -83,6 +84,7 @@ app.post('/eval', (req, res) => {
|
||||||
} finally {
|
} finally {
|
||||||
if (argv.verbose) console.log('Cleaning up Nasal context');
|
if (argv.verbose) console.log('Cleaning up Nasal context');
|
||||||
nasalLib.nasal_cleanup(ctx);
|
nasalLib.nasal_cleanup(ctx);
|
||||||
|
global.gc()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue