Skip to content

Conversation

srawlins
Copy link
Contributor

I've updated docs in object_tracing.c a bit:

  • trace_object_allocations_stop has improved wording.
  • trace_object_allocations_clear now has a comment about the consequences on garbage-collecting.

I think that the example in the rdoc for trace_object_allocations should feature allocation_class_path and allocation_method_id but Koichi-san might want to do this in a specific way.

@zzak
Copy link
Member

zzak commented Oct 15, 2013

@srawlins Thanks for the patch!

I will check on the garbage collection note, and then commit your patch.

Feel free to submit a patch for allocation_class_path and allocation_method_id and we can discuss it there.

@zzak
Copy link
Member

zzak commented Oct 16, 2013

@srawlins You may also be interested in the following new methods to ext/objspace:

  • ObjectSpace.trace_object_allocations_debug_start: 17e1c72
  • ObjectSpace.reachable_objects_from_root: ede6826

@srawlins
Copy link
Contributor Author

@zzak ObjectSpace.trace_object_allocations_debug_start looks interesting, but Koichi-san didn't leave any rdoc there. :/ The ChangeLog comment is cryptic.

ObjectSpace.reachable_objects_from_root does have some rdoc ("Return all reachable objects from root.") but it's not clear what is the difference between this and ObjectSpace.each_object, other than returning a Hash versus an Enumerator (maybe that is all).

I'd like to experiment with these method, thanks for the tip!

@zzak
Copy link
Member

zzak commented Oct 23, 2013

@srawlins I have confirmed with koichi-san that GC still runs during active trace_object_allocations, you can see yourself:

require 'objspace'

ObjectSpace.trace_object_allocations {
  loop { ' ' }
}

If you watch OS memory usage, it should indicate that GC is working.

I will commit your patch for trace_object_allocations_stop

@zzak zzak closed this in 2cfdbd7 Nov 7, 2013
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Nov 8, 2013
  By @srawlins [Fixes rubyGH-421] ruby#421


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jan 24, 2014
  By @srawlins [Fixes rubyGH-421] ruby#421


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants