Ruby内存泄漏

时间:2015-07-07 09:54:50

标签: ruby postgresql sequel

我使用Ruby和Sequel,PostgreSQL(' pg' gem)和em-webosket来解析一些数据并将其存储在数据库中。我通过'守护进程运行我的脚本'宝石。

有时候,当我的脚本崩溃时,我会在守护进程日志中收到此错误。我怎样才能找到错误的来源?

  • I, [2015-07-07T11:15:32.476751 #21491] INFO -- : *** below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions ***
  • E, [2015-07-07T11:15:32.477956 #21491] ERROR -- : stream closed (IOError)
  • E, [2015-07-07T11:15:32.478231 #21491] ERROR -- : failed to allocate memory (NoMemoryError)
  • E, [2015-07-07T11:15:32.478350 #21491] ERROR -- : stack level too deep (SystemStackError)
  • E, [2015-07-07T11:15:32.478758 #21491] ERROR -- : exception reentered (fatal)
  • E, [2015-07-07T11:15:32.481995 #21491] ERROR -- : No such file or directory @ unlink_internal - /home/cloud/paralela/ws.rb_monitor.pid (Errno::ENOENT)
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/pidfile.rb:103:in `delete'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/pidfile.rb:103:in `zap'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/monitor.rb:114:in `stop'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:158:in `stop_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/controller.rb:64:in `run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:144:in `block in run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `call'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `catch_exceptions'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:143:in `run'
    • server.rb:3:in `<main>'
  • E, [2015-07-07T11:15:32.483217 #21491] ERROR -- : cannot load such file -- sequel (LoadError)
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/paralela/ws.rb:6:in `<top (required)>'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `load'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `start_load'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:297:in `start'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:151:in `block (2 levels) in start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:150:in `fork'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:150:in `block in start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:149:in `each'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:149:in `start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/controller.rb:66:in `run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:144:in `block in run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `call'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `catch_exceptions'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:143:in `run' server.rb:3:in `<main>'
  • E, [2015-07-07T11:15:32.487555 #21491] ERROR -- : cannot load such file -- sequel_pg (LoadError)
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/sequel-4.23.0/lib/sequel/adapters/postgres.rb:855:in `<top (required)>'
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:97:in `load_adapter'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:26:in `adapter_class'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:55:in `connect'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/sequel-4.23.0/lib/sequel/core.rb:95:in `connect'
    • /home/cloud/paralela/ws.rb:12:in `<top (required)>'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `load'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `start_load'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:297:in `start'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:151:in `block (2 levels) in start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:150:in `fork'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:150:in `block in start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:149:in `each'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:149:in `start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/controller.rb:66:in `run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:144:in `block in run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `call'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `catch_exceptions'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:143:in `run'
    • server.rb:3:in `<main>'
  • E, [2015-07-07T11:15:32.491328 #21491] ERROR -- : cannot load such file -- pg (LoadError)
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    • /home/cloud/paralela/ws.rb:8:in `<top (required)>'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `load'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `start_load'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application.rb:297:in `start'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:151:in `block (2 levels) in start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:150:in `fork'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:150:in `block in start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:149:in `each'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/application_group.rb:149:in `start_all'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/controller.rb:66:in `run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:144:in `block in run'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `call'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `catch_exceptions'
    • /home/cloud/.rvm/gems/ruby-2.2.1/gems/daemons-1.2.2/lib/daemons.rb:143:in `run'
    • server.rb:3:in `<main>'

0 个答案:

没有答案