public long ramBytesUsed() {long sizeInBytes = 0;for(Map.Entry<String,DirectField> entry: fields.entrySet()) {sizeInBytes += entry.getKey().length() * Character.BYTES;sizeInBytes += entry.getValue().ramBytesUsed();}return sizeInBytes;}
public override long RamBytesUsed(){long sizeInBytes = 0;foreach (KeyValuePair<string, DirectField> entry in fields){sizeInBytes += entry.Key.Length*RamUsageEstimator.NUM_BYTES_CHAR;sizeInBytes += entry.Value.RamBytesUsed();}return sizeInBytes;}