[2608.14471] Memory Allocation for Constant-Bounded Programs Skip to main content Search Submit Donate Log in Search arXiv Press Enter to search · Advanced search Computer Science > Programming Languages arXiv:2608.14471 (cs) [Submitted on 14 Aug 2026] Title: Memory Allocation for Constant-Bounded Programs Authors: Vinícius Silva , Kael Soares , Márcio Costa e Fernando Magno Quintão Pereira View a PDF of the paper titled Memory Allocation for Constant-Bounded Programs, by Vin\'icius Silva and 2 other authors View PDF HTML (experimental) Abstract: This work studies memory allocation for constant-bounded programs, whose execution length is syntactically limited for all inputs. Examples of such programs include verified kernel extensions, cryptographic routines, and fixed-shape machine-learning models. We show that constant boundedness enables a tight, polynomial-time approximation of optimal stack usage by viewing control flow as a tree and applying a tree-scan allocation strategy augmented with memory defragmentation. Our approach guarantees memory usage bounded by the maximum live memory plus, at most, the size of the largest buffer, and is optimal when in-place swapping is permitted. We deploy the proposed allocator in two scenarios. First, in an Elixir-to-eBPF compiler, as a spiller that optimizes stack space. Second, as a static heap allocator for bounded MLIR programs using the Structured Control-Flow dialect. Results demonstrate stack reductions exceeding 90% on real eBPF workloads and show that, even under aggressive code expansion, defragmentation is rarely required and memory usage remains a small fraction of that required by naive allocation strategies. Comments: 13 pages, 13 figures Subjects: Programming Languages (cs.PL) MSC classes: 68N15 ACM classes: D.3.4 Cite as: arXiv:2608.14471 [cs.PL] (or arXiv:2608.14471v1 [cs.PL] for this version) https://doi.org/10.48550/arXiv.2608.14471 Focus to learn more arXiv-issued DOI via DataCite Submission history From: Fernando Quintao Pereira [ view email ] [v1] Fri, 14 Aug 2026 16:52:25 UTC (546 KB) Full-text links: Access Paper: View a PDF of the paper titled Memory Allocation for Constant-Bounded Programs, by Vin\'icius Silva and 2 other authors View PDF HTML (experimental) TeX Source view license Current browse context: cs.PL < prev | next > new | recent | 2026-08 Change to browse by: cs References & Citations NASA ADS Google Scholar Semantic Scholar export BibTeX citation Loading... BibTeX formatted citation × loading... Data provided by: Bookmark Bibliographic Tools Bibliographic and Citation Tools Bibliographic Explorer Toggle Bibliographic Explorer ( What is the Explorer? ) Connected Papers Toggle Connected Papers ( What is Connected Papers? ) Litmaps Toggle Litmaps ( What is Litmaps? ) scite.ai Toggle scite Smart Citations ( What are Smart Citations? ) Code, Data, Media Code, Data and Media Associated with this Article alphaXiv Toggle alphaXiv ( What is alphaXiv? ) Links to Code Toggle CatalyzeX Code Finder for Papers ( What is CatalyzeX? ) DagsHub Toggle DagsHub ( What is DagsHub? ) GotitPub Toggle Gotit.pub ( What is GotitPub? ) Huggingface Toggle Hugging Face ( What is Huggingface? ) ScienceCast Toggle ScienceCast ( What is ScienceCast? ) Demos Demos Replicate Toggle Replicate ( What is Replicate? ) Spaces Toggle Hugging Face Spaces ( What is Spaces? ) Spaces Toggle TXYZ.AI ( What is TXYZ.AI? ) Related Papers Recommenders and Search Tools Link to Influence Flower Influence Flower ( What are Influence Flowers? ) Core recommender toggle CORE Recommender ( What is CORE? ) Author Venue Institution Topic About arXivLabs arXivLabs: experimental projects with community collaborators arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website. Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them. Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs . Which authors of this paper are endorsers? | Disable MathJax ( What is MathJax? ) We gratefully acknowledge support from our major funders , member institutions , , and all contributors. About · Help · Contact · Subscribe · Copyright · Privacy · Accessibility · Operational Status (opens in new tab) Major funding support from