pmq20 / ruby-packer

Packing your Ruby application into a single executable.
MIT License
1.56k stars 99 forks source link

Ran into a "virtual memory exhausted" error #74

Open ubugnu opened 6 years ago

ubugnu commented 6 years ago

I created a fresh rails 5.2.0 app with:

rails new test_app

Then I executed:

./rubyc test_app/bin/rails

I get:

...
compiling ./missing/strlcpy.c
compiling addr2line.c
compiling dln.c
compiling localeinit.c
compiling prelude.c
virtual memory exhausted: Ne peut allouer de la mémoire
Makefile:364: recipe for target 'enclose_io_memfs.o' failed
make: *** [enclose_io_memfs.o] Error 1
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe  -I/tmp/rubyc/zlib  -I/tmp/rubyc/openssl/include  -I/tmp/rubyc/gdbm/build/include  -I/tmp/rubyc/yaml/build/include  -I/tmp/rubyc/libffi/build/lib/libffi-3.2.1/include  -I/tmp/rubyc/ncurses/build/include  -I/tmp/rubyc/readline/build/include ", "LDFLAGS"=>" -L/tmp/rubyc/zlib /tmp/rubyc/zlib/libz.a  -L/tmp/rubyc/openssl  -L/tmp/rubyc/gdbm/build/lib  -L/tmp/rubyc/yaml/build/lib  -L/tmp/rubyc/libffi/build/lib  -L/tmp/rubyc/ncurses/build/lib  -L/tmp/rubyc/readline/build/lib ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>nil, "ENCLOSE_IO_RUBYC_2ND_PASS"=>"1"}, "make -j4"]

8G of virtual memory exhausted, not normal!

iamsimakov commented 5 years ago

hi, I use rubyc too, please wirte how much your memory sum RAM+Swap? I think 10 GB would be OK. In my case I have 6 GB RAM and 4 GB Swap and prelude.c compiling use almost all it memory. Also I tried to change swap to 6 GB (sum 12 GB).

bodgit commented 5 years ago

I think I ran into this, I have 32 GB RAM and I found while compiling prelude.c I had a clang process that had chewed through 62 GB of RAM so I killed it off before it took the whole machine down.

Nakilon commented 3 years ago

I am compiling a tiny Ruby script. It takes like half an hour and in the end:

 CONSTFUNC(void rb_secure_update(VALUE));
 ^~~~~~~~~
In file included from ./include/ruby/ruby.h:2005,
                 from ./include/ruby.h:33,
                 from internal.h:15,
                 from io.c:14:
./include/ruby/intern.h:257:1: warning: 'const' attribute on function returning 'void' [-Wattributes]
 CONSTFUNC(void rb_error_untrusted(VALUE));
 ^~~~~~~~~
./include/ruby/intern.h:259:1: warning: 'const' attribute on function returning 'void' [-Wattributes]
 CONSTFUNC(void rb_check_trusted(VALUE));
 ^~~~~~~~~
In file included from io.c:14:
internal.h:976:1: warning: 'const' attribute on function returning 'void' [-Wattributes]
 CONSTFUNC(void rb_gc_mark_encodings(void));
 ^~~~~~~~~
gcc: fatal error: Killed signal terminated program cc1
compilation terminated.
make: *** [Makefile:364: enclose_io_memfs.o] Error 1
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe  -I/tmp/rubyc/zlib  -I/tmp/rubyc/openssl/include  -I/tmp/rubyc/gdbm/build/include  -I/tmp/rubyc/yaml/build/include  -I/tmp/rubyc/libffi/build/lib/libffi-3.2.1/include  -I/tmp/rubyc/ncurses/build/include  -I/tmp/rubyc/readline/build/include ", "LDFLAGS"=>" -L/tmp/rubyc/zlib /tmp/rubyc/zlib/libz.a  -L/tmp/rubyc/openssl  -L/tmp/rubyc/gdbm/build/lib  -L/tmp/rubyc/yaml/build/lib  -L/tmp/rubyc/libffi/build/lib  -L/tmp/rubyc/ncurses/build/lib  -L/tmp/rubyc/readline/build/lib ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>nil, "ENCLOSE_IO_RUBYC_2ND_PASS"=>"1"}, "make -j4"]