# test.rb
#!/usr/bin/env ruby
puts "hello"
warn "whut?"
raise "oops!"
# spawntest.rb
file = File.join(__dir__, 'test.rb')
Process.spawn(file, :out => ['test.log', 'a'])
>ruby spawntest.rb
Error: Your application used more memory than the safety cap of 500M.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace