rails - 为rails消耗的内存做检测 memory leak 检测工具 derailed_benchmarks

栏目: Ruby · 发布时间: 4年前

内容简介:参考:和 另外一种更牛的方式:安装:

参考: https://github.com/schneems/derailed_benchmarks

和 另外一种更牛的方式: https://collectiveidea.com/blog/archives/2015/02/19/optimizing-rails-for-memory-usage-part-1-before-you-optimize

安装:

# 检测内存泄漏
gem 'derailed_benchmarks', group: :development
gem 'stackprof', group: :development

然后 $ bundle 就可以

运行:

1. 查看各种Gem占用的内存

root@test-server:/opt/app/test.wondercv.com/current# bundle exec derailed bundle:mem
TOP: 117.3281 MiB
  rails/all: 21.5273 MiB
    rails: 9.9023 MiB (Also required by: active_record/railtie, active_model/railtie, and 12 others)
      active_support/railtie: 4.5859 MiB
        active_support/i18n_railtie: 4.5859 MiB
          active_support/file_update_checker: 2.6797 MiB (Also required by: rails/application/configuration)
            active_support/core_ext/time/calculations: 2.6797 MiB (Also required by: active_support/core_ext/time, active_support/core_ext/numeric/time)
              active_support/core_ext/time/conversions: 2.0195 MiB (Also required by: active_support/core_ext/time, active_support/core_ext/date_time/conversions)
                active_support/values/time_zone: 1.7695 MiB (Also required by: active_support/time_with_zone, active_support/core_ext/date_time/conversions)
                  tzinfo: 1.7695 MiB
                    tzinfo/timezone: 0.5156 MiB
  awesome_rails_console: 6.5273 MiB
    awesome_rails_console/railtie: 6.5078 MiB
      pry-rails: 6.0273 MiB
        pry: 6.0273 MiB
          pry/cli: 2.8281 MiB
            /root/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/pry-byebug-3.6.0/lib/pry-byebug/cli.rb: 2.8281 MiB
              pry-byebug/pry_ext: 2.4492 MiB
                byebug/processors/pry_processor: 2.4492 MiB
                  byebug/core: 2.4492 MiB
                    byebug/commands: 1.8711 MiB
                      byebug/commands/irb: 0.7461 MiB (Also required by: /root/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/byebug-10.0.2/lib/byebug/settings/autoirb.rb)
                        irb: 0.7461 MiB
                          irb/ruby-lex: 0.4922 MiB
          pry/commands: 1.6602 MiB
      awesome_print: 0.4805 MiB
  uglifier: 5.7539 MiB
    execjs: 4.543 MiB (Also required by: coffee_script)
      execjs/runtimes: 0.6445 MiB
    uglifier/version: 0.9922 MiB
  amoeba: 4.4961 MiB
    active_record/base: 3.9805 MiB
      active_record/validations: 0.7734 MiB
        active_model/validations: 0.5156 MiB
      active_record/querying: 0.3711 MiB
  pg: 3.9648 MiB
    pg_ext: 3.707 MiB

以上所述就是小编给大家介绍的《rails - 为rails消耗的内存做检测 memory leak 检测工具 derailed_benchmarks》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Flash PHP实用开发技术

Flash PHP实用开发技术

Steve Webster著、王黎译 / 王黎 / 清华大学出版社 / 2002-3 / 39.00元

本书将介绍服务器端脚本所提供的各种可能的操作方案,帮助读者掌握设计数据库集成程序和高端应用程序的知识。一起来看看 《Flash PHP实用开发技术》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具