# Memory usage of binaries from juliac compiler?

**URL:** <https://discourse.julialang.org/t/memory-usage-of-binaries-from-juliac-compiler/116918>\
**Category:** General Usage\
**Tags:** memory, juliac\
**Created:** [July 11, 2024, 3:35pm UTC](https://discourse.julialang.org/t/memory-usage-of-binaries-from-juliac-compiler/116918 "2024-07-11T15:35:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [July 11, 2024, 3:35pm UTC](https://discourse.julialang.org/t/memory-usage-of-binaries-from-juliac-compiler/116918/1 "2024-07-11T15:35:16Z")

</div>

There has been a JuliaCon talk about generating small binaries with juliac:

> **[New Ways to Compile Julia Juliacon 2024](https://pretalx.com/juliacon2024/talk/FUTLND/)**
>
> We will explain new options for ahead-of-time compilation of julia programs that we have been developing. First, there is a new compiler driver \`juliac\` that provides a more traditional gcc-like command-line interface. Next, we are adding new...

This brings down the binary size, but does it bring down the startup RAM usage? It’s currently more than 200 MB on Linux.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 12, 2024, 7:21am UTC](https://discourse.julialang.org/t/memory-usage-of-binaries-from-juliac-compiler/116918/2 "2024-07-12T07:21:05Z")

</div>

Depends on what your code is like. It can generate binaries without the Julia runtime if your code doesn’t require it, which would make the problem entirely go away. But if you need the runtime, do you need BLAS? Etc.

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [July 17, 2024, 7:20am UTC](https://discourse.julialang.org/t/memory-usage-of-binaries-from-juliac-compiler/116918/3 "2024-07-17T07:20:09Z")

</div>

Sorry it does not answer the question but where can juliac be found? I would like to try it. Thank you

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [July 17, 2024, 8:19am UTC](https://discourse.julialang.org/t/memory-usage-of-binaries-from-juliac-compiler/116918/4 "2024-07-17T08:19:15Z")

</div>

`juliac` is work-in-progress and not released.

If you feel adventurous you can build this PR:

> <https://github.com/JuliaLang/julia/pull/55047>
>
> This adds a command line option \`--static-call-graph\` that builds images where c…ode is only included if it is statically reachable from methods marked using the new function \`entrypoint\`. Compile-time errors are given for call sites that are too dynamic to allow trimming the call graph (however there is an \`unsafe\` option if you want to try building anyway to see what happens).
> 
> The PR has two other components. One is changes to Base that generally allow more code to be compiled in this mode. These changes will either be merged in separate PRs or moved to a separate part of the workflow (where we will build a custom system image for this purpose). The branch is set up this way to make it easy to check out and try the functionality.
> 
> The other component is everything in the \`juliac/\` directory, which implements a compiler driver script based on this new option, along with some examples and tests. This will eventually become a package "app" that depends on PackageCompiler and provides a CLI for all of this stuff, so it will not be merged here. To try an example:
> 
> \`\`\`
> cd juliac
> ../julia juliac.jl --output-exe hello --trim exe\_examples/hello\_world.jl
> \`\`\`
> 
> When stripped the resulting executable is currently about 900kb on my machine.
> 
> Note the script calls this \`--trim\`, which will be the official name of this option (following similar functionality in .NET). It is not yet clear if this is identical to the internal \`--static-call-graph\` option, or if the latter is an implementation detail of the former.
> 
> Also includes a lot of work by @topolarity
