[前][次][番号順一覧][スレッド一覧]

ruby-changes:49843

From: nobu <ko1@a...>
Date: Fri, 19 Jan 2018 23:51:01 +0900 (JST)
Subject: [ruby-changes:49843] nobu:r61961 (trunk): test_io.rb: avoid OOM

nobu	2018-01-19 23:50:55 +0900 (Fri, 19 Jan 2018)

  New Revision: 61961

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61961

  Log:
    test_io.rb: avoid OOM
    
    * test/ruby/test_io.rb (TestIO#test_copy_stream_socket7): reduce
      memory usage so the worker process will not die by OOM.

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 61960)
+++ test/ruby/test_io.rb	(revision 61961)
@@ -869,7 +869,8 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L869
               s1.close
               IO.select([s2])
               Process.kill(:USR1, Process.ppid)
-              s2.read
+              buf = String.new(capacity: 16384)
+              nil while s2.read(16384, buf)
             end
             s2.close
             nr.times do

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]