Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created April 3, 2012 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansissel/2295501 to your computer and use it in GitHub Desktop.
Save jordansissel/2295501 to your computer and use it in GitHub Desktop.
Original details here: http://www.engineyard.com/blog/2010/monitoring-memory-with-jruby-part-1-jhat-and-visualvm/
Debugging memory in logstash with this:
```
# Run JRuby with special flag
% ruby -J-Djruby.reify.classes=true --1.9 bin/logstash agent ...
```
```
% jmap -histo:live $(jps | awk '/Main/ { print $1 }') | grep -F ' rubyobj' | head -10
41: 10093 242232 rubyobj.FTW.Connection
166: 387 9288 rubyobj.Gem.Version
167: 375 9000 rubyobj.Gem.Requirement
200: 208 4992 rubyobj.Gem.Dependency
298: 83 1992 rubyobj.Gem.Specification
537: 12 288 rubyobj.LogStash.Event
623: 10 240 rubyobj.Gem.Platform
700: 7 168 rubyobj.Cabin.Metrics
1042: 5 120 rubyobj.OptionParser.Switch.NoArgument
1046: 5 120 rubyobj.Cabin.Metrics.Timer
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment