【问题标题】:How to find and fix a Rails and Couchbase memory leak如何查找和修复 Rails 和 Couchbase 内存泄漏
【发布时间】:2014-12-29 23:47:17
【问题描述】:

我有以下测试代码:

def loop_bucket_gets
    bucket = Couchbase::Bucket.new({:node_list => ['xxx.xxx.xxx.xxx:8091', 'yyy.yyy.yyy.yyy:8091'],
                                    :bucket => 'Foo',
                                    :pool => 'default',
                                    :expires_in => 1.day,
                                    :default_format => :marshal,
                                    :key_prefix => '_foo'
                                   })

    i = 0
    loop do
      begin
        i += 1
        bucket.get "ABC#{i}"
      rescue ::Couchbase::Error::Base => e
        nil
      end
    end
  end

当我在 Rails 控制台中执行此操作时,内存泄漏。

我正在使用:

  • couchbase 1.3.10 gem
  • libcouchbase 2.4.3

我在https://www.couchbase.com/issues/browse/RCBC-187创建了一个问题

【问题讨论】:

标签: ruby-on-rails ruby caching couchbase


【解决方案1】:

这个loop 将无限期使用。你应该通过一个破坏条件。

【讨论】:

  • 这没有回答问题。用户希望有一个修复内存泄漏的实现。您将如何处理当前代码?
猜你喜欢
  • 1970-01-01
  • 2013-02-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-12
  • 2018-05-09
  • 2018-07-12
相关资源
最近更新 更多