Class: RMem::Report

Inherits:
Object
  • Object
show all
Defined in:
ext/rmem.c

Class Method Summary collapse

Class Method Details

.memoryObject



75
76
77
78
79
80
81
82
# File 'ext/rmem.c', line 75

static VALUE ruby_memory_report(VALUE self)
{
  unsigned long bytes;
  if( report_memory_usage(&bytes) ) {
    rb_raise(rb_eRuntimeError, "Error detecting runtime memory usage");
  }
  return rb_int_new(bytes);
}

.memory_for(pid) ⇒ Object



84
85
86
87
88
89
90
91
# File 'ext/rmem.c', line 84

static VALUE ruby_memory_report_for(VALUE self, VALUE pid)
{
  unsigned long bytes;
  if( report_memory_usage_by_pid(FIX2LONG(pid), &bytes) ) {
    rb_raise(rb_eRuntimeError, "Error detecting runtime memory usage");
  }
  return rb_int_new(bytes);
}