class NewRelic::Agent::Samplers::MemorySampler::JavaHeapSampler

Public Instance Methods

get_memory() click to toggle source
# File lib/new_relic/agent/samplers/memory_sampler.rb, line 92
def get_memory
  raise "Can't sample Java heap unless running in JRuby" unless defined? JRuby
  java.lang.Runtime.getRuntime.totalMemory / (1024 * 1024).to_f rescue nil
end
to_s() click to toggle source
# File lib/new_relic/agent/samplers/memory_sampler.rb, line 97
def to_s
  "JRuby Java heap sampler"
end