Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Allocation tracing #117

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

WIP: Allocation tracing #117

wants to merge 9 commits into from

Conversation

jhawthorn
Copy link
Owner

@jhawthorn jhawthorn commented Dec 17, 2024

I want to add the ability to trace and query allocation information about specific objects in the same way that ObjectSpace.trace_object_allocations works, except with full stack information.

obj = nil
allocations = Vernier::AllocationTracer.trace do
  obj = Object.new
end
stack = allocations.stack(obj)
puts stack
# Class#new at <cfunc>:0
# block in <main> at /Users/jhawthorn/src/vernier/test_allocation_tracing.rb:5
# Vernier::AllocationTracer#trace at /Users/jhawthorn/src/vernier/lib/vernier/allocation_tracer.rb:19
# Vernier::AllocationTracer.trace at /Users/jhawthorn/src/vernier/lib/vernier/allocation_tracer.rb:13
# <main> at /Users/jhawthorn/src/vernier/test_allocation_tracing.rb:4

TODO: retained profiling mode should be built off of this functionality

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.

1 participant