| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bd17f0b commit e18de80
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,22 +8,26 @@ if (common.isIBMi) | |||
| 8 | 8 | common.skip('On IBMi, the rss memory always returns zero'); | |
| 9 | 9 | ||
| 10 | 10 | const v8 = require('v8'); | |
| 11 | - const assert = require('assert'); | ||
| 12 | 11 | ||
| 13 | 12 | const before = process.memoryUsage.rss(); | |
| 14 | 13 | ||
| 15 | 14 | for (let i = 0; i < 1000000; i++) { | |
| 16 | 15 | v8.serialize(''); | |
| 17 | 16 | } | |
| 18 | 17 | ||
| 19 | - global.gc(); | ||
| 20 | - | ||
| 21 | - const after = process.memoryUsage.rss(); | ||
| 22 | - | ||
| 23 | - if (process.config.variables.asan) { | ||
| 24 | - assert(after < before * 10, `asan: before=${before} after=${after}`); | ||
| 25 | - } else if (process.config.variables.node_builtin_modules_path) { | ||
| 26 | - assert(after < before * 4, `node_builtin_modules_path: before=${before} after=${after}`); | ||
| 27 | - } else { | ||
| 28 | - assert(after < before * 2, `before=${before} after=${after}`); | ||
| 18 | + async function main() { | ||
| 19 | + await common.gcUntil('RSS should go down', () => { | ||
| 20 | + const after = process.memoryUsage.rss(); | ||
| 21 | + if (process.config.variables.asan) { | ||
| 22 | + console.log(`asan: before=${before} after=${after}`); | ||
| 23 | + return after < before * 10; | ||
| 24 | + } else if (process.config.variables.node_builtin_modules_path) { | ||
| 25 | + console.log(`node_builtin_modules_path: before=${before} after=${after}`); | ||
| 26 | + return after < before * 10; | ||
| 27 | + } | ||
| 28 | + console.log(`before=${before} after=${after}`); | ||
| 29 | + return after < before * 10; | ||
| 30 | + }); | ||
| 29 | 31 | } | |
| 32 | + | ||
| 33 | + main(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments