Skip to content

[Feature] usedHeap() to get a percentage value of currently used heap space #19

@Sv443

Description

@Sv443
const v8 = require("v8");
const scl = require("svcorelib");

function usedHeap()
{
	const heapStat = v8.getHeapStatistics();

	const max = heapStat.heap_size_limit;
	const val = heapStat.used_heap_size;

	return scl.mapRange(val, 0, max, 0, 100).toFixed(2);
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions