#043 Memory Profiling
About memory profiling in Ruby.
Notes
WIP: just dropping some unorganised notes for now..
Get current ruby process memory usage
See also:
Running the test_get_process_memory.rb script:
$ ruby test_get_process_memory.rb
RSS according to OS.rss_bytes: 17.5104 MB
RSS according to ps: 17.522688 MB
memory_profiler gem
With NewRelic
https://docs.newrelic.com/docs/agents/ruby-agent/features/developer-mode Developer mode is removed and no longer supported as of Ruby agent version 4.1.0.
Include the newrelic_rpm gem in your Gemfile and invoke it thus:
NewRelic::Agent::Samplers::MemorySampler.new.sampler.get_sample