<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63236>63236</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            orc::InProcessMemoryMapper makes too many memory mappings
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          gbaraldi
      </td>
    </tr>
</table>

<pre>
    First seen in https://github.com/JuliaLang/julia/pull/49745, but to summarize, InProcessMemoryMapper calls `mprotect` many many times on `mmap`ed memory, so many times that for a non trivial workload we go past `/proc/sys/vm/max_map_count` leading to a `ENOMEM` error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8Uk1v3CAQ_TX4grLygs2uDxzSNpZaddv-g2hsZr0kfInBm25_fYWTqj1UuQCCN4837w0Q2SUgatZ_YP2nBtZyiVkvE2RwxjZTNDc92kyFE2LgNvBLKYmYvGdiZGJcbLms026Ononxy-osfIWwMDE-1TMTY1qdY2LshkPXM_GRT2vhJXJavYdsf2G9-xx-5Dgj0Ql9zLcTpISZz-AccaZan3IsOBemWu4h3F6XYj0Sj2FDeEhMtWi43xgqKcV_ceUChZ9j5sBDDLxke7Xg-EvMzy6C4S_Il8gTUKl8VXeOMxMj3YiJ8Vq78_Dz0UN6nOMaNi0Owdiw1HagVj18-356ONUXzDnmXWO0NIMcoEG9V0clh-E4iOaiUR4m7KZuPvTnozStkmAOs0DRYYtHYxqrRStkq_btXoiuF7u96o-Hoevn_VmdUXWsa9GDdTvnrn4X89JYohW1kkKqxsGEjv5kmnUF3U3rQqxrnaVCf8uKLQ51zHNNVN7_PwkPz9XC-Oboq8fcQ0o2LNSs2el3pqL-9bbdpRyfapJi3PRWbzfJvwMAAP__lLLVkg">