Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d58867a

Browse filesBrowse files
refackMylesBorins
authored andcommitted
test: call gc() explicitly to avoid OOM
PR-URL: #22301 Refs: nodejs/reliability#12 Refs: #16354 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent f5985c7 commit d58867a
Copy full SHA for d58867a

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js‎

Copy file name to clipboardExpand all lines: test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Flags: --expose-gc
12
'use strict';
23

34
const common = require('../../common');
@@ -29,10 +30,13 @@ assert.throws(function() {
2930
buf.toString('latin1');
3031
}, /"toString\(\)" failed/);
3132

33+
// FIXME: Free the memory early to avoid OOM.
34+
// REF: https://github.com/nodejs/reliability/issues/12#issuecomment-412619655
35+
global.gc();
3236
let maxString = buf.toString('latin1', 1);
3337
assert.strictEqual(maxString.length, kStringMaxLength);
34-
// Free the memory early instead of at the end of the next assignment
3538
maxString = undefined;
39+
global.gc();
3640

3741
maxString = buf.toString('latin1', 0, kStringMaxLength);
3842
assert.strictEqual(maxString.length, kStringMaxLength);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.