Skip to content

Commit c59468a

Browse files
vchuravygbaraldi
andauthored
Limit memory use during 32bit build (#50272)
Co-authored-by: Gabriel Baraldi <[email protected]>
1 parent 7b565e3 commit c59468a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Make.inc

+6
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,12 @@ endef
15001500
# Overridable in Make.user
15011501
WINE ?= wine
15021502

1503+
ifeq ($(BINARY),32)
1504+
HEAPLIM := --heap-size-hint=500M
1505+
else
1506+
HEAPLIM :=
1507+
endif
1508+
15031509
# many of the following targets must be = not := because the expansion of the makefile functions (and $1) shouldn't happen until later
15041510
ifeq ($(BUILD_OS), WINNT) # MSYS
15051511
spawn = $(1)

contrib/generate_precompile.jl

+1
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
465465
print("Total ─────── "); Base.time_print(stdout, tot_time); println()
466466
finally
467467
fancyprint && print(ansi_enablecursor)
468+
GC.gc(true); GC.gc(false); # reduce memory footprint
468469
return
469470
end
470471

sysimage.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ RELBUILDROOT := $(call rel_path,$(JULIAHOME)/base,$(BUILDROOT)/base)/ # <-- make
5959

6060
$(build_private_libdir)/corecompiler.ji: $(COMPILER_SRCS)
6161
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
62-
$(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp \
62+
$(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" $(HEAPLIM) --output-ji $(call cygpath_w,$@).tmp \
6363
--startup-file=no --warn-overwrite=yes -g$(BOOTSTRAP_DEBUG_LEVEL) -O0 compiler/compiler.jl)
6464
@mv $@.tmp $@
6565

6666
$(build_private_libdir)/sys.ji: $(build_private_libdir)/corecompiler.ji $(JULIAHOME)/VERSION $(BASE_SRCS) $(STDLIB_SRCS)
6767
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
6868
if ! JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) WINEPATH="$(call cygpath_w,$(build_bindir));$$WINEPATH" \
69-
$(call spawn, $(JULIA_EXECUTABLE)) -g1 -O0 -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \
69+
$(call spawn, $(JULIA_EXECUTABLE)) -g1 -O0 -C "$(JULIA_CPU_TARGET)" $(HEAPLIM) --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \
7070
--startup-file=no --warn-overwrite=yes --sysimage $(call cygpath_w,$<) sysimg.jl $(RELBUILDROOT); then \
7171
echo '*** This error might be fixed by running `make clean`. If the error persists$(COMMA) try `make cleanall`. ***'; \
7272
false; \
@@ -82,7 +82,7 @@ $$(build_private_libdir)/sys$1-o.a $$(build_private_libdir)/sys$1-bc.a : $$(buil
8282
JULIA_PROJECT= \
8383
JULIA_DEPOT_PATH=':' \
8484
JULIA_NUM_THREADS=1 \
85-
$$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
85+
$$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" $$(HEAPLIM) --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
8686
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $(JULIA_PRECOMPILE); then \
8787
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \
8888
false; \

0 commit comments

Comments
 (0)