[PATCH] [JITLink] Always unmap standard segments in InProcessMemoryManager::deallocat...
authorMin-Yih Hsu <min.hsu@sifive.com>
Sat, 17 Feb 2024 00:19:56 +0000 (16:19 -0800)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 23 Sep 2024 11:23:31 +0000 (13:23 +0200)
commit05a71363b13ca4b806b0b57fef14da8e15d26825
tree83510a222dff27056a7f2946ee0f96ac17a6dac6
parent9d17496375fd3484bd5368c24147cab2af6a5261
[PATCH] [JITLink] Always unmap standard segments in InProcessMemoryManager::deallocate (#81943)

Right now InProcessMemoryManager only releases a standard segment (via
sys::Memory::releaseMappedMemory) in `deallocate` when there is a
DeallocAction associated, leaving residual memory pages in the process
until termination.
Despite being a de facto memory leak, it won't cause a major issue if
users only create a single LLJIT instance per process, which is the most
common use cases. It will, however, drain virtual memory pages if we
create thousands of ephemeral LLJIT instances in the same process.

This patch fixes this issue by releasing every standard segments
regardless of the attached DeallocAction.

Gbp-Pq: Name rv64-fix-mm-leak.diff
llvm/lib/ExecutionEngine/JITLink/JITLinkMemoryManager.cpp