public long ramBytesUsed() {long sizeInBytes = BASE_RAM_BYTES_USED;sizeInBytes += (docIDs!=null)? RamUsageEstimator.sizeOf(docIDs) : 0;sizeInBytes += (freqs!=null)? RamUsageEstimator.sizeOf(freqs) : 0;if(positions != null) {sizeInBytes += RamUsageEstimator.shallowSizeOf(positions);for(int[] position : positions) {sizeInBytes += (position!=null) ? RamUsageEstimator.sizeOf(position) : 0;}}if (payloads != null) {sizeInBytes += RamUsageEstimator.shallowSizeOf(payloads);for(byte[][] payload : payloads) {if(payload != null) {sizeInBytes += RamUsageEstimator.shallowSizeOf(payload);for(byte[] pload : payload) {sizeInBytes += (pload!=null) ? RamUsageEstimator.sizeOf(pload) : 0;}}}}return sizeInBytes;}

public override long RamBytesUsed(){long sizeInBytes = 0;sizeInBytes += (docIDs != null) ? RamUsageEstimator.SizeOf(docIDs) : 0;sizeInBytes += (freqs != null) ? RamUsageEstimator.SizeOf(freqs) : 0;if (positions != null){foreach (int[] position in positions){sizeInBytes += (position != null) ? RamUsageEstimator.SizeOf(position) : 0;}}if (payloads != null){foreach (var payload in payloads){if (payload != null){foreach (var pload in payload){sizeInBytes += (pload != null) ? RamUsageEstimator.SizeOf(pload) : 0;}}}}return sizeInBytes;}
