code: function getHeapSpaceStatistics(unitInfo) {
    const arr = v8.getHeapSpaceStatistics();
    const result = {};
    arr.forEach((item) => {
      const data = {};
      const keys = Object.keys(item);
      keys.forEach((key) => {
        if (key === 'space_name') {
          return;
        }
        // replace the space_ key prefix
        data[key.replace('space_', '')] = format(item[key], unitInfo);
      });
      result[item.space_name] = data;
    });
    return result;
  }
docs: Get the heap space statistics
  @param {Object} unitInfo The unit format setting
  @returns {Object} The heap space statistics