无法分配内存

时间:2017-08-03 01:51:03

标签: ruby smartercsv

我有一个12 MB大小的大型csv文件。我的笔记本电脑里有12千兆内存,但我的内存仍然不足。我重新启动了我的笔记本电脑并启动了程序新鲜但我仍然有问题。我正在使用SmarterCSV,希望它能管理大型csv文件但到目前为止没有运气。

    C:\>irb
irb(main):001:0> require 'smarter_csv'
=> true
irb(main):002:0> filename="C:\\Users\\Dino\\Downloads\\mktsymbols_v2.txt"
=> "C:\\Users\\Dino\\Downloads\\mktsymbols_v2.txt"
irb(main):003:0> rows=SmarterCSV.process(filename)
NoMemoryError: failed to allocate memory
        from C:/Ruby23/lib/ruby/2.3.0/irb/inspector.rb:109:in `inspect'
        from C:/Ruby23/lib/ruby/2.3.0/irb/inspector.rb:109:in `block in <module:IRB>'
        from C:/Ruby23/lib/ruby/2.3.0/irb/inspector.rb:102:in `inspect_value'
        from C:/Ruby23/lib/ruby/2.3.0/irb/context.rb:384:in `inspect_last_value'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:661:in `output_value'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:490:in `block (2 levels) in eval_input'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:623:in `signal_status'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:486:in `block in eval_input'
        from C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:246:in `block (2 levels) in each_top_level_statement'
        from C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:232:in `loop'
        from C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
        from C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:231:in `catch'
        from C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:231:in `each_top_level_statement'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:485:in `eval_input'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:395:in `block in start'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:394:in `catch'
        from C:/Ruby23/lib/ruby/2.3.0/irb.rb:394:in `start'
        from C:/Ruby23/bin/irb.cmd:19:in `<main>'
Maybe IRB bug!

0 个答案:

没有答案