MCPcopy Create free account
hub / github.com/apache/datafusion / with_memory_limit

Method with_memory_limit

datafusion/execution/src/runtime_env.rs:416–422  ·  view source on GitHub ↗

Specify the total memory to use while running the DataFusion plan to `max_memory * memory_fraction` in bytes. This defaults to using [`GreedyMemoryPool`] wrapped in the [`TrackConsumersPool`] with a maximum of 5 consumers. Note DataFusion does not yet respect this limit in all cases.

(self, max_memory: usize, memory_fraction: f64)

Source from the content-addressed store, hash-verified

414 ///
415 /// Note DataFusion does not yet respect this limit in all cases.
416 pub fn with_memory_limit(self, max_memory: usize, memory_fraction: f64) -> Self {
417 let pool_size = (max_memory as f64 * memory_fraction) as usize;
418 self.with_memory_pool(Arc::new(TrackConsumersPool::new(
419 GreedyMemoryPool::new(pool_size),
420 NonZeroUsize::new(5).unwrap(),
421 )))
422 }
423
424 /// Use the specified path to create any needed temporary files
425 pub fn with_temp_file_path(mut self, path: impl Into<PathBuf>) -> Self {

Calls 2

newFunction · 0.85
with_memory_poolMethod · 0.45