huge_vec/
huge_vec.rs

1use limit_alloc::Limit;
2use std::alloc::System;
3
4// Limit available RAM to 4MB
5#[global_allocator]
6static A: Limit<System> = Limit::new(4_000_000, System);
7
8fn main() {
9    let _huge_vec: Vec<u8> = Vec::with_capacity(4_000_001);
10}