shecc icon indicating copy to clipboard operation
shecc copied to clipboard

Thoughts on memory usage reduction

Open DrXiao opened this issue 5 months ago • 2 comments

When submitting the pull request (#203 ), I used my beaglebone black (running Debian OS) to build shecc targeting armv7.

However, I found that the current memory usage is too high to build the stage 2 compiler on my beaglebone black.

debian@BeagleBone:~/shecc$ make
env printf "ARCH=arm" > .session.mk
Target machine code switch to arm
Warning: missing packages: dot jq
Warning: Please check package installation
  CC+LD out/inliner
  GEN   out/libc.inc
  CC    out/src/main.o
  LD    out/shecc
  SHECC out/shecc-stage1.elf
  SHECC out/shecc-stage2.elf
[ 1830.930466] Out of memory: Killed process 1995 (shecc-stage1.el) total-vm:1875560kB, anon-rss:429492kB, file-rss:148kB, shmem-rss:0kB, UID:1000 pgtables:1832kB oom_score_adj:0
make: *** [Makefile:115: out/shecc-stage2.elf] Killed

It would be better to reduce the memory usage so that the build process can complete even on low-memory ARM machines.

DrXiao avatar May 18 '25 14:05 DrXiao