Commit ceeb661
authored
aotcompile: destroy LLVM context after serializing combined module (JuliaLang#59329)
We already save some memory here by deleting the `jl_native_code_desc_t`
after
we're done serializing the combined module, but some data in the
module's
`LLVM::Context` lives on until the end of the scope in
`jl_dump_native_impl`.
Once we're done with the module, move the lock and `ThreadSafeContext`
so the
reference count drops to zero.
A crude measurement shows that when compiling the Base sysimage, about 3
GiB is
in use. Deleting the `jl_native_code_desc_t` (as before) saves about 600
MiB,
and cleaning up the context saves an additional ~500 MiB.1 parent c6e7650 commit ceeb661
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2271 | 2271 | | |
2272 | 2272 | | |
2273 | 2273 | | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
2277 | 2282 | | |
2278 | 2283 | | |
2279 | 2284 | | |
| |||
0 commit comments