File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 8787 exit 1
8888fi
8989
90- # Check memory only on Linux (not available on Windows)
91- if [[ " $OSTYPE " != " msys" && " $OSTYPE " != " win32" ]]; then
90+ # Check memory and limit threads if needed
91+ if [[ " $OSTYPE " == " msys" || " $OSTYPE " == " win32" ]]; then
92+ # Windows: use wmic or PowerShell
93+ export JULIA_IMAGE_THREADS=4
94+ totalmem=$( powershell.exe -Command " (Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1MB" 2> /dev/null | awk ' {printf "%i", $1}' )
95+ if [[ -z " $totalmem " || $totalmem -lt 27000 ]]; then
96+ echo " Warning: Less than 27GB of memory detected on Windows. Using only one thread for sysimage compilation."
97+ export JULIA_IMAGE_THREADS=1
98+ fi
99+ else
100+ # Linux: use /proc/meminfo
92101 totalmem=$( grep MemTotal /proc/meminfo | awk ' {printf "%i", $2 / 1024}' )
93102 if [[ $totalmem -lt 27000 ]]; then
94103 echo " Warning: Less than 27GB of memory detected. Using only one thread for sysimage compilation."
You can’t perform that action at this time.
0 commit comments