0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-v8-stats.js
Roman Klauke ad7f74453d src: add total_available_size to v8 statistics
v8 introduced the new flag `total_available_size` in version 4.4
and upwards. This flag is now available on `v8.getHeapStatistics`
with the name `total_available_size`. It contains the total
available heap size of v8.

Introduced with commit: v8/v8-git-mirror@0a1352a7

PR-URL: https://github.com/nodejs/io.js/pull/2348
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-11 22:51:50 +02:00

18 lines
418 B
JavaScript

'use strict';
var common = require('../common');
var assert = require('assert');
var v8 = require('v8');
var s = v8.getHeapStatistics();
var keys = [
'heap_size_limit',
'total_available_size',
'total_heap_size',
'total_heap_size_executable',
'total_physical_size',
'used_heap_size'];
assert.deepEqual(Object.keys(s).sort(), keys);
keys.forEach(function(key) {
assert.equal(typeof s[key], 'number');
});