# Increase size of precompilation cache

**URL:** <https://discourse.julialang.org/t/increase-size-of-precompilation-cache/121444>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [October 18, 2024, 7:10am UTC](https://discourse.julialang.org/t/increase-size-of-precompilation-cache/121444 "2024-10-18T07:10:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [October 18, 2024, 7:10am UTC](https://discourse.julialang.org/t/increase-size-of-precompilation-cache/121444/1 "2024-10-18T07:10:11Z")

</div>

I’m running a number of Pluto notebooks with heavy dependencies. I noticed that opening a not-so-old notebook almost always involves precompilation, suggesting that the package manager has somehow deleted the precompiled code from its `.julia` cache folder. I think there’s an option to tell Pkg to never `gc`, but that’s a bit drastic? Is there any other way to tune its behaviour, eg. by increasing the cache size?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [October 18, 2024, 7:51am UTC](https://discourse.julialang.org/t/increase-size-of-precompilation-cache/121444/2 "2024-10-18T07:51:21Z")

</div>

Set the environment variable [`JULIA_MAX_NUM_PRECOMPILE_FILES`](https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_MAX_NUM_PRECOMPILE_FILES).

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [October 18, 2024, 8:02am UTC](https://discourse.julialang.org/t/increase-size-of-precompilation-cache/121444/3 "2024-10-18T08:02:01Z")

</div>

Do you know if that’s the only logic that triggers a precompilation file deletion? Subjectively, its default of 10 doesn’t match my perception.
