How to use the heapdump.writeSnapshot function in heapdump

To help you get started, we’ve selected a few heapdump examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber-archive / hyperbahn / test / lib / time-series-cluster.js View on Github external
function firstHeap() {
        /* eslint no-console:0 */
        console.log('writing first heap');
        heapdump.writeSnapshot(HEAP_FILE_ONE);
    }
github outmoded / poop / lib / index.js View on Github external
process.once('uncaughtException', async (err) => {

        HeapDump.writeSnapshot(Path.join(settings.heapdumpFolder, 'heapdump-' + Date.now() + '.heapsnapshot'));

        // Don't try to catch any errors since the process is exiting anyway.
        await Utils.log(err, {
            logPath: settings.logPath,
            writeStreamOptions: settings.writeStreamOptions
        });

        process.exit(1);
    });
github observing / exception / index.js View on Github external
Exception.writable('disk', function disk() {
  var location = path.resolve(this.directory, 'exceptions', this.filename);

  //
  // First write our own dump of gathered information.
  //
  try { fs.writeFileSync(location +'.json', JSON.stringify(this, null, 2)); }
  catch (e) { console.error('Failed to write exception to disk', e); }

  //
  // Now try to write out the heap dump.
  //
  heapdump.writeSnapshot(location +'.heapsnapshot');

  return this;
});
github zeit / pkg / test / test-79-npm / heapdump / heapdump.js View on Github external
'use strict';

var fs = require('fs');
var heapdump = require('heapdump');
var name = './heapdump.heapsnapshot';
heapdump.writeSnapshot(name, function (error1, filename) {
  if (error1) throw error1;
  fs.unlink(filename, function (error2) {
    if (error2) throw error2;
    console.log('ok');
  });
});
github qlik-oss / enigma.js / test / profile / profile.js View on Github external
async function cleanup(innerSession, err) {
      if (err) {
        console.error(err);
      }

      await innerSession.close();

      if (enableHeap) {
        heapdump.writeSnapshot(`./${stamp}-iteration-${iterationNumber}.heapsnapshot`);
      }
    }
github 94cstyles / push / app.js View on Github external
memwatch.on('leak', function(info) {
        var file = require('path').resolve('./heapdump/' + process.pid + '-' + Date.now() + '.heapsnapshot');
        heapdump.writeSnapshot(file, function(err) {
            if (err) console.error(err);
            else console.error('Wrote snapshot: ' + file);
        });
    });
}
github bipio-server / bipio / src / server_nc.js View on Github external
setInterval(function() {
      var f = '/tmp/bipio_NC_' + Date.now() + '.heapsnapshot';
      console.log('Writing ' + f);
      console.log(require.cache);
      heapdump.writeSnapshot(f);
    }, 60000);
  }
github guanyuxin / baogame / game / con.js View on Github external
socket.on('heapdump', data => {
					console.log('heapdump');
					heapdump.writeSnapshot('./logs/' + Date.now() + '.heapsnapshot');
				});
			}
github infinispan / js-client / memory-profiling / infinispan_memory_one_get.js View on Github external
var afterPut = put.then(function() {
    //console.log("After put, heapUsed: "+process.memoryUsage().heapUsed);

    heapdump.writeSnapshot('/tmp/' + Date.now() + '.heapsnapshot');
  });
github mortie / mmpc-media-streamer / server.js View on Github external
setTimeout(() => {
			heapdump.writeSnapshot(Date.now()+".heapsnapshot");
			console.log("snapshot written.");
		}, 400000);
	});

heapdump

Make a dump of the V8 heap for later inspection.

ISC
Latest version published 5 years ago

Package Health Score

53 / 100
Full package analysis

Popular heapdump functions

Similar packages