ruby-packer icon indicating copy to clipboard operation
ruby-packer copied to clipboard

Ran into a "virtual memory exhausted" error

Open ubugnu opened this issue 7 years ago • 3 comments

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!

ubugnu avatar Nov 07 '18 16:11 ubugnu

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).

iamsimakov avatar Nov 08 '18 14:11 iamsimakov

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.

bodgit avatar Oct 10 '19 17:10 bodgit

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"]

Nakilon avatar Feb 02 '21 13:02 Nakilon