jwmalloc: A Verified Memory Allocator for Mobile Devices
Jiawei Wang, Ming Fu, Ruixian Wang, Chao Xu, Jonas Oberhauser, Haibo Chen
Abstract
Dynamic memory allocators provide memory allocation and release functionality to languages such as C, C++, and Rust. Existing allocators have been primarily optimized for performance and timely memory release. However, emerging mobile workloads also emphasize CPU, energy, and memory usage under soft real-time constraints.
We present jwmalloc, a novel memory allocator built from the ground up to address these mobile-specific challenges. It is based on three key innovations: a uniform slab size with pooling that enables immediate cross-size-class reuse of any emptied slab; the closed sibling tree, a new data structure for efficiently managing fragments; and a two-buffer lifetime tracker that categorizes short-and long-lived objects to guide memory reclamation. For timely response in soft real-time and oversubscription scenarios, all operations are non-blocking. We verified jwmalloc with a bounded model checker under weak memory models. Replacing jemalloc on a flagship smartphone running real-world workloads, jwmalloc reduces wholesystem instructions by 10% and cuts allocator-side instruction counts by 3.84×, while lowering CPU power consumption by 5-11%, all at a comparable memory footprint. jwmalloc has been deployed in production on 12 million commercial mobile devices, operating stably for over 30 billion user hours.
Open the app market, search for and install a specific app, then uninstall the app. browser1
Open a browser app, enter a URL, and stay on the page. browser2
Open a browser app, enter a URL, and scroll the web page. camera_record Open the camera app, switch to video mode, and start recording. game_center Open the game center app, browse its home screen, then exit the app. ebook_reading Open a reader app, open the first book, and turn pages. input_method Swipe down from the home screen, tap the search box, and search for a keyword. location Open the device-finding app and refresh the location. map Open a map app, search for a keyword, and start navigation. mms1
Open the messages app, enter the message list, view the first message, and scroll back. mms2
Open the messages app, enter the message list, and scroll. music1
Open a music app and play a local audio file. music2
Open a music app and play local music with the screen off. music3
Open a music app, enter the local song list, and scroll the list. notepad Open the notepad app, create a new note, and switch between tabs. photo_library Open the photo library, tap "Albums", tap "Photos", enter the thumbnail view, and scroll. home_screen1
Enter an enlarged folder, swipe once, and exit. home_screen2
Launch the settings app and swipe up to send it to the background. home_screen3
Continuously launch Settings, Notepad, Messages, Phone, and Calendar; enter the multitasking interface and repeatedly swipe. home_screen4
Repeatedly increase and decrease the volume. home_screen5
Repeatedly pull down the control center and then exit it. home_screen6
Enter the minus-one screen (leftmost panel) and repeatedly swipe. home_screen7
Enter an enlarged folder, then repeatedly open and exit it. screen_record From the home screen, pull down the control center, tap screen recording, record a clip, then stop and return to the home screen. setting1
Open the settings app and repeatedly swipe. setting2
Open the settings app, log in to the account, tap "Scan", select a QR code from Photos, and scan. floating_window Open the settings app, swipe up to the floating-window area, and release to create a floating window. theme_manager Open the theme app and repeatedly swipe on the home page. shopping1
Open a shopping app and scroll down to browse products. shopping2
Open a shopping app, enter the "Me" page, and swipe. weather1
Open the weather app and send it to the background. weather2
Open the weather app and swipe left to switch cities.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 1e8af7fe-2c70-43b2-bd81-0d5a33b212d3Builds on10
- Verus: Verifying Rust Programs using Linear Ghost TypesAndrea Lattuada, Travis Hance, Chanhee Cho, Matthias Brun et al.OOPSLA 2023 · 86 citations
- RefinedC: automating the foundational verification of C code with refined ownership typesMichael Sammler, Rodolphe Lepigre, Robbert Krebbers, Kayvan Memarian et al.PLDI 2021 · 83 citations
- Learning-based Memory Allocation for C++ Server WorkloadsMartin Maas, David G. Andersen, Michael Isard, Mohammad Mahdi Javanmard et al.ASPLOS 2020 · 59 citations
- VSync: push-button verification and optimization for synchronization primitives on weak memory modelsJonas Oberhauser, Rafael Lourenco de Lima Chehab, Diogo Behrens, Ming Fu et al.ASPLOS 2021 · 40 citations
- Verus: A Practical Foundation for Systems VerificationAndrea Lattuada, Travis Hance, Jay Bosamiya, Matthias Brun et al.SOSP 2024 · 22 citations
Related papers
- MemPerf: Profiling Allocator-Induced Performance SlowdownsJin Zhou, Sam Silvestro, Steven (Jiaxun) Tang, Hanmei Yang et al.OOPSLA 2023
- HEAPSTER: Analyzing the Security of Dynamic Allocators for Monolithic Firmware ImagesFabio Gritti, Fabio Pagani, Ilya Grishchenko, Lukas Dresel et al.S&P 2022 · 31 citations
- PIM-Malloc: A Fast and Scalable Dynamic Memory Allocator for Processing-In-Memory (PIM) ArchitecturesDongjae Lee, Bongjoon Hyun, Youngjin Kwon, Minsoo RhuHPCA 2026 · 1 citation
- Preventing Use-After-Free Attacks with Fast Forward AllocationBrian Wickman, Hong Hu, Insu Yun, Daehee Jang et al.USENIX Security 2021 · 53 citations
- Are dynamic memory managers on GPUs slow?: a survey and benchmarksMartin Winter, Mathias Parger, Daniel Mlakar, Markus SteinbergerPPoPP 2021 · 25 citations
