Skip to content

Commit 0a8e2c8

Browse files
chore(apollo_compile_to_casm): limit casm compilation memory usage
1 parent c4a0cc9 commit 0a8e2c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/apollo_compile_to_casm/src/compiler.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use tracing::info;
1111
use crate::config::SierraCompilationConfig;
1212
use crate::constants::CAIRO_LANG_BINARY_NAME;
1313

14+
// TODO(Noa): Reconsider the default value.
15+
const DEFAULT_MAX_MEMORY_USAGE: u64 = 5 * 1024 * 1024 * 1024;
16+
1417
#[derive(Clone)]
1518
pub struct SierraToCasmCompiler {
1619
pub config: SierraCompilationConfig,
@@ -37,7 +40,7 @@ impl SierraToCasmCompiler {
3740
"--allowed-libfuncs-list-name",
3841
"all",
3942
];
40-
let resource_limits = ResourceLimits::new(None, None, None);
43+
let resource_limits = ResourceLimits::new(None, None, Some(DEFAULT_MAX_MEMORY_USAGE));
4144

4245
let stdout = compile_with_args(
4346
compiler_binary_path,

0 commit comments

Comments
 (0)