-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allocating too much memory failed to allocate memory (NoMemoryError)
#381
Comments
So your strace suggest that it's the cache for Couple questions:
|
@byroot I posted the entire file as a hex dump in the original posting. Here is the outputs requested
RubyVM:
|
Hum, that's really a weird one. So based on what you say about touching the file, when you do this you actually bypass the cache for that one file. It's regenerated but not used until a subsequent run. No idea what the bug actually is at this stage, but a few more thing to confirm my suspicion. First try: RubyVM::InstructionSequence.compile_file("/srv/www/ops-lib/ops-cli2.rb").eval Then in a new irb: RubyVM::InstructionSequence.load_from_binary(RubyVM::InstructionSequence.compile_file("/srv/www/ops-lib/ops-cli2.rb").to_binary).eval If I'm right either both or the last one should fail, and if so you likely ran into a Ruby bug of some sort. Also if it does reproduce and there's nothing secret in that |
First try:
So that works properly Second:
So both are working.... I also posted the original rb file, its just a small bootstrapping file
I would love to share the docker container, but there's too much secret in there to share |
Wow, that's extremely weird, I really don't get what might be happening here :/ |
I made sure the issue is in bootsnap
disabling bootsnap fixes the issue
Steps to reproduce
Currently unknown. The issue seems to happen intermittently with an identical build process
Expected behavior
Application should run
Actual behavior
NoMemoryError is thrown
System configuration
Bootsnap version: 1.9.1
Ruby version: 2.7.2
Rails version: 6.1.3.2
I've noticed some very strange behavior regarding bootsnap and don't know where the root is. After updating from 1.5.1 to 1.9.1, and moving tmp to a symlink pointing to
/tmp
, we started running into an intermittent NoMemoryError upon startup.I noticed that if I would
touch
the ruby file, the error would go away. I ran anstrace
on it, and it appeared to be allocating over 9GB of ram, causing the error to throwContext:
/srv/www/ops-lib/ops-cli2.rb
is the name of the script, and contains/srv/www/ops-lib/tmp/cache/bootsnap/compile-cache/b6/5cc8804abfcc92
You can see after it reads in the first line, it does an mmap of
9296302080
bytes.After touching the file, it works correctly
strace output:
The text was updated successfully, but these errors were encountered: