Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3941dbd authored by Frederick Mayle's avatar Frederick Mayle
Browse files

init: run scudo's M_PURGE_ALL before idling

For a microdroid VM of interest, this reduce the RSS of the scudo mmap
from 836 kb to 540 kb.

Bug: 416570070
Test: boot VM
Flag: EXEMPT ...
Change-Id: I3ecbe052451c951e9cc73de1d9c14447ab7f5aa0
parent d02ff378
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1208,6 +1208,10 @@ int SecondStageMain(int argc, char** argv) {
        if (next_action_time != far_future) {
            epoll_timeout = std::chrono::ceil<std::chrono::milliseconds>(
                    std::max(next_action_time - boot_clock::now(), 0ns));
        } else {
            // If we are unlikely to do anything soon, release memory from the
            // allocator.
            mallopt(M_PURGE_ALL, 0);
        }
        auto epoll_result = epoll.Wait(epoll_timeout);
        if (!epoll_result.ok()) {