-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
add --track-heap-objects #2135
add --track-heap-objects #2135
Conversation
Does doc/iojs.1 also need to be modified? |
I am not able to understand why we need the whitespace changes. |
@thefourtheye it was to keep 2 spaces between the switch and the description and keeping all of the descriptions aligned |
@ofrobots i can but I saw that |
@bmeck Ah, I see what you are saying now. |
@thefourtheye correct |
// --track-heap-objects | ||
if (track_heap_objects) { | ||
READONLY_PROPERTY(process, "trackHeapObjects", True(env->isolate())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we explicitly set this to False
, in the else
part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of the other switches work that way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it even need to be exposed to JS land?
(I guess the same question applies to .traceSyncIO
, /cc @trevnorris.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. You're right. I can't think of a useful case to expose either of them to JS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. @bmeck Can you remove the .trackHeapObjects
property (and .traceSyncIO
in a separate commit if you want)?
@bnoordhuis removed trackHeapObjects from process, separate PR for traceSyncIO #2143 |
LGTM |
LGTM |
Do we need a test for this? |
@thefourtheye node itself does not include a way to dump heap snapshots, we could write one up but it would be akin to including |
- This makes v8 add .trace_function_info to the serialized form of snapshots from v8::HeapSnapshot::Serialize - .trace_funciton_info combined with .trace_node in snapshots tells the JS location that allocated a specific object
eaa89b7
to
bd77a59
Compare
- This makes v8 add .trace_function_info to the serialized form of snapshots from v8::HeapSnapshot::Serialize - .trace_funciton_info combined with .trace_node in snapshots tells the JS location that allocated a specific object PR-URL: #2135 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
Squashed and landed in cf14a24. |
Tagged as |
Notable changes * src: Added a new `--track-heap-objects` flag to track heap object allocations for heap snapshots (Bradley Meck) nodejs#2135. * readline: Fixed a freeze that affected the repl if the keypress event handler threw (Alex Kocharin) nodejs#2107. * npm: Upgraded to v2.13.0, release notes can be found in https://github.com/npm/npm/releases/tag/v2.13.0 (Forrest L Norvell) nodejs#2152. PR-URL: nodejs#2189
Right now we do not have a way to start iojs with heap object tracking.
Calling
v8::Profiler::StartTrackingHeapObjects
after node has started up will not include the reference info for objects in node core. This can be seen by runningnode-heapdump
with the flag turned on. This information is useful for debugging tools and would be visible in Chrome DevTools in the same way that "Record heap allocation stack traces" functions from the DevTools settings pane.