%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
'use strict'; // Flags: --expose-gc // just like test-gc-http-client.js, // but aborting every connection that comes in. const common = require('../common'); const onGC = require('../common/ongc'); const http = require('http'); const os = require('os'); const cpus = os.cpus().length; let createClients = true; let done = 0; let count = 0; let countGC = 0; function serverHandler(req, res) { res.connection.destroy(); } const server = http.createServer(serverHandler); server.listen(0, common.mustCall(() => { for (let i = 0; i < cpus; i++) getAll(); })); function getAll() { if (!createClients) return; const req = http.get({ hostname: 'localhost', pathname: '/', port: server.address().port }, cb).on('error', cb); count++; onGC(req, { ongc }); setImmediate(getAll); } function cb(res) { done += 1; } function ongc() { countGC++; } setImmediate(status); function status() { if (done > 0) { createClients = false; global.gc(); console.log(`done/collected/total: ${done}/${countGC}/${count}`); if (countGC === count) { server.close(); return; } } setImmediate(status); }