Class: HeapScope::Runtime::JRuby

Inherits:
Base
  • Object
show all
Defined in:
lib/heapscope/runtime/jruby.rb

Overview

Placeholder adapter — JRuby introspection differs from MRI.

Instance Attribute Summary

Attributes inherited from Base

#engine

Instance Method Summary collapse

Methods inherited from Base

#allocation_info, #allocation_tracing?, #gc_stat, #gc_stat?, #memsize?, #memsize_of, #process_metadata, #reachable_objects?, #reachable_objects_from, #rss_bytes, #rss_tracking?, #start_allocation_tracing, #stop_allocation_tracing

Constructor Details

#initializeJRuby

Returns a new instance of JRuby.



9
10
11
# File 'lib/heapscope/runtime/jruby.rb', line 9

def initialize
  super(engine: "jruby")
end

Instance Method Details

#each_object(klass = nil) ⇒ Object

Raises:



17
18
19
20
21
22
23
24
25
# File 'lib/heapscope/runtime/jruby.rb', line 17

def each_object(klass = nil, &)
  raise CapabilityError, "ObjectSpace.each_object unavailable on JRuby" unless each_object?

  if klass
    ObjectSpace.each_object(klass, &)
  else
    ObjectSpace.each_object(&)
  end
end

#each_object?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/heapscope/runtime/jruby.rb', line 13

def each_object?
  defined?(ObjectSpace) && ObjectSpace.respond_to?(:each_object)
end