node heapdump

Write a node service

const Koa = require('koa')
const app = new Koa()
class SetMap extends Map {
    
     }
const myMap = new SetMap()
let id = 0
app.use(async (ctx, next) => {
    
    
  ctx.id = id++
  myMap.set(id, ctx)
  await next()
});
app.use(async ctx => {
    
    
  console.log(ctx.id)
  ctx.body = 'Hello World' + ctx.id;
});
app.listen(3004);

Install Apache ab

ab: Download the Windows version
, unzip and copy the bin directory to the environment variable path

Open chrome://inspect/#devices configuration address

Insert image description here

Run node --inspect app.js to start the service

Run ab -n 1000 -c 10 http://127.0.0.1:3004/ and press the interface

Click Open dedicated DevTools for Node to take a snapshot

Insert image description here

Guess you like

Origin blog.csdn.net/qq_42975676/article/details/128703761