# Julia image threads on Windows

**URL:** https://discourse.julialang.org/t/julia-image-threads-on-windows/129328
**Category:** General Usage
**Tags:** package-compiler, system-image
**Created:** [May 25, 2025, 11:10pm UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328 "2025-05-25T23:10:53Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)
#### Post date: [May 25, 2025, 11:10pm UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/1 "2025-05-25T23:10:53Z")

</div>

As far as I know, by default _PackageCompiler_ uses `JULIA_IMAGE_THREADS=1` on Windows and all cores on Linux (Julia v1.10) due to which it completes much faster on Linux, but uses more RAM. I set on Windows system variable to 12 which is my number of cores, but that did not appear to do anything. Does Julia support using more than 1 image thread on Windows? Is this missing feature or a bug? Can Linux behavior of parallelism be recreated on Windows?

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [May 26, 2025, 4:18am UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/2 "2025-05-26T04:18:06Z")

</div>

It does not support that because of limitations of the linker on Windows. The parts created by different threads need to be linked together. I do not know if a work-around for this problem would be possible. See: [High number of external symbols in Windows 10 when creating sysimages with julia 1.10.0-beta1 · Issue #50954 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/50954)

The open - and unanswered - question in this issue is, why does the package compiler add `--export-all-symbols` to the linker parameters which results in too many symbols.

---

<div class="post-metadata">

### Author: ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)
#### Post date: [May 26, 2025, 11:19am UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/3 "2025-05-26T11:19:10Z")

</div>

Thank you for detailed answer. I am looking forward if someone will be fixing this.

Besides functionality, it is not in documentation that this is not working on Windows.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [May 26, 2025, 11:22am UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/4 "2025-05-26T11:22:06Z")

</div>

Perhaps you can create an issue “Missing support for multi-threaded system image creation on Windows” in the package PackageCompiler.jl ? To make this work probably changes to both PackageCompiler.jl and Julia are required.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [May 26, 2025, 2:42pm UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/5 "2025-05-26T14:42:51Z")

</div>

People are working on fixing this, and if I’m reading correctly, have already done so on master that you can try checking out, I’m not on Windows to test, but curious if it works):

> **[Fix hanging system image creation if multiple threads are set ·...](https://github.com/JuliaLang/PackageCompiler.jl/commit/0f2d3b70cff4a72fd77d0af68de93e2491abd346)**
>
> Make sure, that the final system image is built single-threaded and
> override any values set by "-t", "--threads" in sysimage\_build\_args\`
> or provided via JULIA\_NUM\_THREADS.
> Th...

```julia
using Pkg

Pkg.add(PackageSpec(url="https://github.com/JuliaLang/PackageCompiler.jl", rev="master"))

in case I'm wrong about master, check out that PR/commit:

Pkg.add(PackageSpec(url="https://github.com/JuliaLang/PackageCompiler.jl", rev="0f2d3b70cff4a72fd77d0af68de93e2491abd346"))

```

Note, it was limited to 1 thread, by design, as a workaround, that’s now apparently no longer needed:

> <https://github.com/JuliaLang/PackageCompiler.jl/pull/1041>
>
> ref, https://discourse.julialang.org/t/packagecompiler-hangs-while-compiling-non…incremental-system-image-on-julia-v1-11/128099/14

This was a problem on 1.11, but less of a problem on 1.10? I hope both fixed now, and if not try either with fewer threads \> 1.

> [@KSepetanc](#):
>
> Does Julia support using more than 1 image thread on Windows?

Julia does for sure support threads on Windows too. This was only a problem while compiling. I think, though not sure, that you could compile with 1 thread to make the compiling work, but then when using that compiled code have as many threads as you like.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [May 26, 2025, 2:50pm UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/6 "2025-05-26T14:50:52Z")

</div>

> [@Palli](#):
>
> Julia does for sure support threads on Windows too.

No, it does NOT support multi-threaded system image generation on Windows. The issue you are referring here is a very different issue. It was more an issue on Linux when creating a non-incremental system image. Creating an incremental system image using multiple threads on Linux always worked and still works, at least with Julia 1.10 and 1.11. It does not work multithreaded on Windows. Not sure if it was always like that or if there are old Julia versions where it still works.

---

<div class="post-metadata">

### Author: ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)
#### Post date: [May 26, 2025, 8:47pm UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/7 "2025-05-26T20:47:18Z")

</div>

I created the [issue](https://github.com/JuliaLang/PackageCompiler.jl/issues/1044) on _PackageCompiler.jl_.

---

<div class="post-metadata">

### Author: ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)
#### Post date: [October 18, 2025, 2:16pm UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/8 "2025-10-18T14:16:21Z")

</div>

I closed the issue at _PackageCompiler.jl_ as I thought that PR [#59736](https://github.com/JuliaLang/julia/pull/59736) resolves it (included with 1.12.1). However, now I am not so sure that it is resolved as compilation time for my case is longer on Windows that Linux. However, I am observing massive regression in compilation time from 1.11 to 1.12 even on Linux so if someone else could evaluate on some other example that would be great. If needed I can reopen the issue if not resolved.

---

<div class="post-metadata">

### Author: ![KSepetanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksepetanc/32/10841_2.png) [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)
#### Post date: [November 30, 2025, 10:59am UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/9 "2025-11-30T10:59:23Z")

</div>

Did anyone try it if it is resolved with latest 1.12? I am observing very significat compile time regression with 1.12 (even on linux) so hard to say.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [December 1, 2025, 3:47am UTC](https://discourse.julialang.org/t/julia-image-threads-on-windows/129328/10 "2025-12-01T03:47:51Z")

</div>

Yes, with Julia 1.12.2, Julia image creation happens threaded. My [test script](https://github.com/OpenSourceAWE/KiteModels.jl/blob/main/test/test_installation) for installing a large package and creating a system image takes about 15min on Linux and 26min on Windows (in a virtual machine) now. Just the system image creation on Windows takes about 7 min. Single threaded the numbers are 34min and 14 min, so the image threads save 7-8 minutes. I will try to add a comparison against Linux in virtual machine (which would be fairer) when I find the time.

Important: I use the following code to switch between single and multi-threaded system image creation:

```julia-auto
# Check memory and limit threads if needed
if [["$OSTYPE" == "msys" || "$OSTYPE" == "win32"]]; then
    # Windows: use wmic or PowerShell
    echo "Checking system memory on Windows..."
    totalmem=$(powershell.exe -Command "(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1MB" 2>/dev/null | awk '{printf "%i", $1}')
    if [[-z "$totalmem" || $totalmem -lt 27000]]; then
        echo "Warning: Less than 27GB of memory detected on Windows. Using only one thread for sysimage compilation."
        export JULIA_IMAGE_THREADS=1
    fi
else
    # Linux: use /proc/meminfo
    totalmem=$(grep MemTotal /proc/meminfo | awk '{printf "%i", $2 / 1024}')
    if [[$totalmem -lt 27000]]; then
        echo "Warning: Less than 27GB of memory detected. Using only one thread for sysimage compilation."
        export JULIA_IMAGE_THREADS=1
    fi
fi

```

For multithreaded image generation, at least 27GB of RAM are needed.
