Ruby Code help

I am trying to print out the Garbage Collection behavior. I tried the
following code:–

include ObjectSpace
puts ObjectSpace.statistics

but its giving me an error like this:–

runtest.rb:6: undefined method `statistics’ for ObjectSpace:Module
(NoMethodError)

Any suggestion… How can i print the Garbage collector Behavior?

Regards

Tridib

On Mon, Nov 28, 2011 at 7:47 PM, Tridib B.
[email protected] wrote:

Any suggestion… How can i print the Garbage collector Behavior?

ObjectSpace.statistics is only provided by Ruby Enterprise Edition, not
MRI.

http://www.rubyenterpriseedition.com/index.html

You can use GC.stat to check it in 1.9.3

On Mon, Nov 28, 2011 at 9:45 PM, Eric C. <
removed_em[email protected]> wrote:

runtest.rb:6: undefined method `statistics’ for ObjectSpace:Module
(NoMethodError)

Any suggestion… How can i print the Garbage collector Behavior?

ObjectSpace.statistics is only provided by Ruby Enterprise Edition, not
MRI.

http://www.rubyenterpriseedition.com/index.html


Sincerely,

Isaac S.

Then you won’t be able to see any information. Use REE or 1.9.3.

2011/11/29, Isaac S. [email protected]:

Am using Ruby 1.8.6

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs