Skip to content

Commit 0f27b6e

Browse files
committed
efi: Make the heap size more reasonable
When booting a VM with 512MiB assigned to it almost half was being lost to the heap allocator and the amount of heap allocations that the firmware does should easily fit into the new 2MiB limit. Signed-off-by: Rob Bradford <[email protected]>
1 parent 229f53d commit 0f27b6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/efi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ fn extract_path(device_path: &DevicePathProtocol, path: &mut [u8]) {
924924
}
925925

926926
const PAGE_SIZE: u64 = 4096;
927-
const HEAP_SIZE: usize = 256 * 1024 * 1024;
927+
const HEAP_SIZE: usize = 2 << 20; /* 2MiB */
928928

929929
// Populate allocator from E820, fixed ranges for the firmware and the loaded binary.
930930
fn populate_allocator(info: &dyn bootinfo::Info, image_address: u64, image_size: u64) {

0 commit comments

Comments
 (0)