Check Memory Usage and Other Things without Cluster Admin


The Jvm type can be a useful resource that allows you to profile memory usage on your nodes as well as many other things. Below is a script you can use to check old_gen percentage on all your cluster nodes.

Cluster.hosts().forEach(function(n) {
	console.log(n.nodeId, ": ", Jvm.memory().pools['PS Old Gen'].percentage, "%");
1 Like


I have had issues where the Jvm.memory() would fail due to various problems which would cause the tunnel to never exit which can become a hassle. I use this one to prevent that:

Cluster.hosts().forEach(n => {
  try {
    c3Tunnel(n.nodeId + ":8080");
    console.log(n.nodeId, ": ", Jvm.memory().pools['PS Old Gen'].percentage);
  } catch (err) {
    console.log(n.nodeId + ': Failed to get memory')
    console.log('\t' + err.message)
1 Like