public static long getTsRecordMem(TSRecord tsRecord) {
    long memUsed = 8; // time
    memUsed += 8; // deviceId reference
    memUsed += tsRecord.deviceId.ramBytesUsed();
    for (DataPoint dataPoint : tsRecord.dataPointList) {
      memUsed += 8; // dataPoint reference
      memUsed += getDataPointMem(dataPoint);
    }
    return memUsed;
  }
Calculate how much memory will be used if the given record is written to sequence file.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/MemUtils.java