| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a562729 commit 9feee1f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | + // Flags: --expose-gc | ||
| 1 | 2 | 'use strict'; | |
| 2 | 3 | ||
| 3 | 4 | const common = require('../../common'); | |
@@ -35,10 +36,13 @@ common.expectsError(function() { | |||
| 35 | 36 | type: Error | |
| 36 | 37 | }); | |
| 37 | 38 | ||
| 39 | + // FIXME: Free the memory early to avoid OOM. | ||
| 40 | + // REF: https://github.com/nodejs/reliability/issues/12#issuecomment-412619655 | ||
| 41 | + global.gc(); | ||
| 38 | 42 | let maxString = buf.toString('latin1', 1); | |
| 39 | 43 | assert.strictEqual(maxString.length, kStringMaxLength); | |
| 40 | - // Free the memory early instead of at the end of the next assignment | ||
| 41 | 44 | maxString = undefined; | |
| 45 | + global.gc(); | ||
| 42 | 46 | ||
| 43 | 47 | maxString = buf.toString('latin1', 0, kStringMaxLength); | |
| 44 | 48 | assert.strictEqual(maxString.length, kStringMaxLength); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments