private void updatePeakMemoryUsed() { long mem = getMemoryUsage(); if (mem > peakMemoryUsedBytes) { peakMemoryUsedBytes = mem; } }
private void updatePeakMemoryUsed() { long mem = getMemoryUsage(); if (mem > peakMemoryUsedBytes) { peakMemoryUsedBytes = mem; } }
private void updatePeakMemoryUsed() { long mem = getMemoryUsage(); if (mem > peakMemoryUsedBytes) { peakMemoryUsedBytes = mem; } }
this.inMemSorter = existingInMemorySorter; this.peakMemoryUsedBytes = getMemoryUsage(); this.numElementsForSpillThreshold = numElementsForSpillThreshold;
this.inMemSorter = existingInMemorySorter; this.peakMemoryUsedBytes = getMemoryUsage(); this.numElementsForSpillThreshold = numElementsForSpillThreshold;
this.inMemSorter = existingInMemorySorter; this.peakMemoryUsedBytes = getMemoryUsage(); this.numElementsForSpillThreshold = numElementsForSpillThreshold;
Utils.bytesToString(getMemoryUsage()), spillWriters.size(), spillWriters.size() > 1 ? " times" : " time");
Utils.bytesToString(getMemoryUsage()), spillWriters.size(), spillWriters.size() > 1 ? " times" : " time");
Utils.bytesToString(getMemoryUsage()), spillWriters.size(), spillWriters.size() > 1 ? " times" : " time");
private void updatePeakMemoryUsed() { long mem = getMemoryUsage(); if (mem > peakMemoryUsedBytes) { peakMemoryUsedBytes = mem; } }
private UnsafeExternalSorter( TaskMemoryManager taskMemoryManager, TaskContext taskContext, RecordComparator recordComparator, PrefixComparator prefixComparator, int initialSize, long pageSizeBytes, @Nullable UnsafeInMemorySorter existingInMemorySorter) { super(taskMemoryManager, pageSizeBytes); this.taskMemoryManager = taskMemoryManager; this.recordComparator = recordComparator; this.prefixComparator = prefixComparator; if (existingInMemorySorter == null) { this.inMemSorter = new UnsafeInMemorySorter( this, taskMemoryManager, recordComparator, prefixComparator, initialSize); } else { this.inMemSorter = existingInMemorySorter; } this.peakMemoryUsedBytes = getMemoryUsage(); // Register a cleanup task with TaskContext to ensure that memory is guaranteed to be freed at // the end of the task. This is necessary to avoid memory leaks in when the downstream operator // does not fully consume the sorter's output (e.g. sort followed by limit). taskContext.addTaskCompletionListener(t -> this.cleanupResources()); }
Utils.bytesToString(getMemoryUsage()), spillWriters.size(), spillWriters.size() > 1 ? " times" : " time");