ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
PK q]|> memsize_of-c.rinu [ U:RDoc::AnyMethod[iI"memsize_of:ETI"ObjectSpace::memsize_of;TT:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I")Return consuming memory size of obj.;To:RDoc::Markup::BlankLine o;
; [I"JNote that the return size is incomplete. You need to deal with this ;TI"Oinformation as only a *HINT*. Especially, the size of +T_DATA+ may not be ;TI"
correct.;T@o;
; [I"6This method is only expected to work with C Ruby.;T:
@fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I",ObjectSpace.memsize_of(obj) -> Integer
;T0[ I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00PK q]Ö0 cdesc-ObjectSpace.rinu [ U:RDoc::NormalModule[iI"ObjectSpace:ET@0o:RDoc::Markup::Document:@parts[o;;[ :
@fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0o;;[
o:RDoc::Markup::Paragraph;[I"JThe objspace library extends the ObjectSpace module and adds several ;TI"9methods to get internal statistic information about ;TI"object/memory management.;To:RDoc::Markup::BlankLine o;;[I"NYou need to require 'objspace' to use this extension module.;T@o;;[ I"EGenerally, you *SHOULD NOT* use this library if you do not know ;TI"Iabout the MRI implementation. Mainly, this library is for (memory) ;TI"Gprofiler developers and MRI developers who need to know about MRI ;TI"memory usage.;T; I"ext/objspace/objspace.c;T;
0o;;[
o;;[I":The ObjectSpace module contains a number of routines ;TI"Ithat interact with the garbage collection facility and allow you to ;TI"2traverse all living objects with an iterator.;T@o;;[I"QObjectSpace also provides support for object finalizers, procs that will be ;TI"Gcalled when a specific object is about to be destroyed by garbage ;TI"collection.;T@o:RDoc::Markup::Verbatim;[
I"
a = "A"
;TI"
b = "B"
;TI"
;TI"QObjectSpace.define_finalizer(a, proc {|id| puts "Finalizer one on #{id}" })
;TI"QObjectSpace.define_finalizer(b, proc {|id| puts "Finalizer two on #{id}" })
;T:@format0o;;[I"_produces:_;T@o;
;[I" Finalizer two on 537763470
;TI"Finalizer one on 537763480;T;0; I" gc.c;T;
0; 0;
0[ [ [ [[I"
class;T[[:public[[I"_id2ref;TI" gc.c;T[I"allocation_class_path;TI""ext/objspace/object_tracing.c;T[I"allocation_generation;T@H[I"allocation_method_id;T@H[I"allocation_sourcefile;T@H[I"allocation_sourceline;T@H[I"count_nodes;TI"ext/objspace/objspace.c;T[I"count_objects;T@E[I"count_objects_size;T@S[I"count_tdata_objects;T@S[I"define_finalizer;T@E[I"each_object;T@E[I"garbage_collect;T@E[I"memsize_of;T@S[I"memsize_of_all;T@S[I"reachable_objects_from;T@S[I" reachable_objects_from_root;T@S[I"trace_object_allocations;T@H[I"#trace_object_allocations_clear;T@H[I")trace_object_allocations_debug_start;T@H[I"#trace_object_allocations_start;T@H[I""trace_object_allocations_stop;T@H[I"undefine_finalizer;T@E[:protected[ [:private[ [I"
instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0;
0[
@@@9I"lib/cgi/session.rb;TI"lib/weakref.rb;T@9cRDoc::TopLevelPK q]Άw reachable_objects_from_root-c.rinu [ U:RDoc::AnyMethod[iI" reachable_objects_from_root:ETI"-ObjectSpace::reachable_objects_from_root;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::List:
@type:
LABEL:@items[o:RDoc::Markup::ListItem:@label[I"MRI specific feature;T; [o:RDoc::Markup::Paragraph; [I",Return all reachable objects from root.;T:
@fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I"5ObjectSpace.reachable_objects_from_root -> hash
;T0[ I"();T@FI"ObjectSpace;TcRDoc::NormalModule00PK q]8 allocation_sourceline-c.rinu [ U:RDoc::AnyMethod[iI"allocation_sourceline:ETI"'ObjectSpace::allocation_sourceline;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"GReturns the original line from source for from the given +object+.;To:RDoc::Markup::BlankLine o;
; [I"FSee ::trace_object_allocations for more information and examples.;T:
@fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"-allocation_sourceline(object) -> string
;T0[ I" (p1);T@FI"ObjectSpace;TcRDoc::NormalModule00PK q]ƌ:/ / count_tdata_objects-c.rinu [ U:RDoc::AnyMethod[iI"count_tdata_objects:ETI"%ObjectSpace::count_tdata_objects;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"+Counts objects for each +T_DATA+ type.;To:RDoc::Markup::BlankLine o;
; [I"QThis method is only for MRI developers interested in performance and memory ;TI"usage of Ruby programs.;T@o;
; [I"It returns a hash as:;T@o:RDoc::Markup::Verbatim; [
I"A{RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
;TI"D :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
;TI"B ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
;TI"@ Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
;TI"5# T_DATA objects existing at startup on r32276.
;T:@format0o;
; [I"LIf the optional argument, result_hash, is given, it is overwritten and ;TI"6returned. This is intended to avoid probe effect.;T@o;
; [I"QThe contents of the returned hash is implementation specific and may change ;TI"in the future.;T@o;
; [I"=In this version, keys are Class object or Symbol object.;T@o;
; [I"OIf object is kind of normal (accessible) object, the key is Class object. ;TI"LIf object is not a kind of normal (internal) object, the key is symbol ;TI"-name, registered by rb_data_type_struct.;T@o;
; [I"6This method is only expected to work with C Ruby.;T:
@fileI"ext/objspace/objspace.c;T:0@omit_headings_from_table_of_contents_below0I" hash
;T0[ I"(p1 = v1);T@0FI"ObjectSpace;TcRDoc::NormalModule00PK q]%
U U " trace_object_allocations_stop-c.rinu [ U:RDoc::AnyMethod[iI""trace_object_allocations_stop:ETI"/ObjectSpace::trace_object_allocations_stop;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"%Stop tracing object allocations.;To:RDoc::Markup::BlankLine o;
; [I"KNote that if ::trace_object_allocations_start is called n-times, then ;TI"Mtracing will stop after calling ::trace_object_allocations_stop n-times.;T:
@fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"#trace_object_allocations_stop
;T0[ I"();T@FI"ObjectSpace;TcRDoc::NormalModule00PK q]A^ ^ allocation_generation-c.rinu [ U:RDoc::AnyMethod[iI"allocation_generation:ETI"'ObjectSpace::allocation_generation;TT:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"AReturns garbage collector generation for the given +object+.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"
class B
;TI" include ObjectSpace
;TI"
;TI" def foo
;TI"% trace_object_allocations do
;TI" obj = Object.new
;TI"; p "Generation is #{allocation_generation(obj)}"
;TI"
end
;TI" end
;TI" end
;TI"
;TI"%B.new.foo #=> "Generation is 3"
;T:@format0o;
; [I"FSee ::trace_object_allocations for more information and examples.;T:
@fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"-allocation_generation(object) -> Fixnum
;T0[ I" (p1);T@ FI"ObjectSpace;TcRDoc::NormalModule00PK q]eu trace_object_allocations-c.rinu [ U:RDoc::AnyMethod[iI"trace_object_allocations:ETI"*ObjectSpace::trace_object_allocations;TT:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"MStarts tracing object allocations from the ObjectSpace extension module.;To:RDoc::Markup::BlankLine o;
; [I"For example:;T@o:RDoc::Markup::Verbatim; [I"require 'objspace'
;TI"
;TI"
class C
;TI" include ObjectSpace
;TI"
;TI" def foo
;TI"% trace_object_allocations do
;TI" obj = Object.new
;TI"K p "#{allocation_sourcefile(obj)}:#{allocation_sourceline(obj)}"
;TI"
end
;TI" end
;TI" end
;TI"
;TI"#C.new.foo #=> "objtrace.rb:8"
;T:@format0o;
; [I"QThis example has included the ObjectSpace module to make it easier to read, ;TI"Pbut you can also use the ::trace_object_allocations notation (recommended).;T@o;
; [I"LNote that this feature introduces a huge performance decrease and huge ;TI"memory consumption.;T:
@fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"(trace_object_allocations { block }
;T0[ I"();T@*FI"ObjectSpace;TcRDoc::NormalModule00PK q]fҜ # trace_object_allocations_clear-c.rinu [ U:RDoc::AnyMethod[iI"#trace_object_allocations_clear:ETI"0ObjectSpace::trace_object_allocations_clear;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"(Clear recorded tracing information.;T:
@fileI""ext/objspace/object_tracing.c;T:0@omit_headings_from_table_of_contents_below0I"$trace_object_allocations_clear
;T0[ I"();T@FI"ObjectSpace;TcRDoc::NormalModule00PK q]'+ + garbage_collect-c.rinu [ U:RDoc::AnyMethod[iI"garbage_collect:ETI"!ObjectSpace::garbage_collect;TT:publico:RDoc::Markup::Document:@parts[
o:RDoc::Markup::Paragraph; [I"