File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const process = require('process');
5
5
const fs = require ( 'fs' ) ;
6
6
const assert = require ( 'assert' ) ;
7
7
8
+ // Based on: https://github.com/nodejs/node/issues/46347#issuecomment-1413886707
8
9
{
9
10
let currentMemoryUsage = process . memoryUsage ( ) . arrayBuffers ;
10
11
@@ -23,13 +24,13 @@ const assert = require('assert');
23
24
} ;
24
25
setInterval ( reportMemoryUsage , 1000 ) ;
25
26
26
- // after 10 seconds we use Readable.toWeb
27
+ // after 1 second we use Readable.toWeb
27
28
// memory usage should stay pretty much the same since it's still a stream
28
29
setTimeout ( ( ) => {
29
30
randomWebStream = Readable . toWeb ( randomNodeStream ) ;
30
31
} , 1000 ) ;
31
32
32
- // after 15 seconds we start consuming the stream
33
+ // after 2 seconds we start consuming the stream
33
34
// memory usage will grow, but the old chunks should be garbage-collected pretty quickly
34
35
setTimeout ( async ( ) => {
35
36
// eslint-disable-next-line no-unused-vars
You can’t perform that action at this time.
0 commit comments