Building A Full Linux Debug Kernel Optimized From 53GB To 25GB Heap Use

Written by Michael Larabel in Linux Kernel on 27 June 2023 at 10:00 AM EDT. 8 Comments
Processing the vmlinux.o object with objtool has been the most memory intensive step of the Linux kernel build process. Prior patches have already worked to reduce this objtool memory use while compiling the Linux kernel and a big patch series now set for Linux 6.5 is set to sharply reduce the maximum heap use.

When building a full debug Linux kernel build (allyesconfig) with CONFIG_DEBUG_INFO enabled, DWARF creates nearly 200 million relocations. Currently this big Linux kernel debug build can lead to objtool peak heap use hitting 53GB. But thanks to these optimizations coming with Linux 6.5, the peak heap use will drop to around 25GB.

For less intense scenarios, there are benefits too from these objtool optimizations. A distro-type kernel build with Indirect Branch Tracking (IBT) enabled will see objtool's peak heap use drop from 4.2GB to around 2.8GB.

Besides sharply lowering the peak heap use, these objtool optimizations lead to faster run-times too and in turn shorter kernel build times.

It's a nice set of objtool improvements by Josh Poimboeuf. These changes along with some debugging improvements and unwinder enhancements were sent out this morning as part of the objtool changes for the Linux 6.5 kernel.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week