-
-
Save temojin/264925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/projects/jruby ➔ jirb | |
irb(main):001:0> require 'java' | |
=> true | |
irb(main):002:0> import com.sun.tools.attach.VirtualMachine | |
=> Java::ComSunToolsAttach::VirtualMachine | |
irb(main):003:0> vm = VirtualMachine.attach($$.to_s) | |
=> sun.tools.attach.MacosxAttachProvider@47875da7: 3294 | |
irb(main):004:0> histo = vm.heap_histo([].to_java).to_io | |
=> #<IO:0x32b95f72> | |
irb(main):005:0> histo.lines.first(25).each {|line| puts line}; nil | |
num #instances #bytes class name | |
---------------------------------------------- | |
1: 31678 4668744 <constMethodKlass> | |
2: 31678 3811744 <methodKlass> | |
3: 3708 3235168 <instanceKlassKlass> | |
4: 3708 3190600 <constantPoolKlass> | |
5: 46591 2367272 <symbolKlass> | |
6: 3560 2015392 <constantPoolCacheKlass> | |
7: 8435 779744 [B | |
8: 11052 756256 [C | |
9: 3966 729744 java.lang.Class | |
10: 4936 629872 [S | |
11: 11433 457320 java.lang.String | |
12: 5010 448448 [[I | |
13: 6759 324432 java.util.concurrent.ConcurrentHashMap$HashEntry | |
14: 2101 319352 java.lang.reflect.Method | |
15: 5909 283632 java.util.HashMap$Entry | |
16: 4240 253776 [Ljava.lang.Object; | |
17: 2934 211248 org.jruby.runtime.ObjectSpace$WeakReferenceListNode | |
18: 321 210552 <methodDataKlass> | |
19: 2482 156768 [I | |
20: 567 155360 [Ljava.util.HashMap$Entry; | |
21: 3463 138520 java.util.ArrayList | |
22: 229 131904 <objArrayKlassKlass> | |
=> nil | |
irb(main):006:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment