Fork me on GitHub

Project Notes

#043 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

Credits and References

About LCK#43 ruby
Project Source on GitHub Return to the Project Catalog

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.

LittleArduinoProjects LittleModelArt More on my blog