long maxTime = dataSet.getDataProvider().getDataLoader().getMaxDataSetLoadTimeInMillis();
long maxMemUsed = dataSet.getDataProvider().getDataLoader().getMaxMemoryUsedInDataLoad();
if (maxMemUsed > 0 && memoryUsed > maxMemUsed) {
String total = MemoryProfiler.formatSize(maxMemUsed);
throw new DataSetException("Data set load memory usage has been exceeded = " + total);
}
else if (maxTime > 0 && elapsedTime > maxTime) {
String time = Chronometer.formatElapsedTime(maxTime);
throw new DataSetException("Data set load time has been exceeded = " + time);
}
else if (maxSize > 0 && sizeInBytes > maxSize) {
String size = MemoryProfiler.formatSize(maxSize);
throw new DataSetException("Data set size in memory has been exceeded = " + size);
}
}