Skip to content

Debugging: Stabilize hidden classes for improved heap snapshots #8912

Closed
@Raynos

Description

@Raynos
  • Version: 4.4.7
  • Platform: linux
  • Subsystem: http

Currently the http client does not have stable hidden classes so it's hard to debug it.

For example:

These are two different fields that do not exist in the constructor ( https://github.com/nodejs/node/blob/master/lib/_http_client.js#L18-L202 ).

We need to add self.res = null; self.aborted = 0;

Without a stable hidden class for the ClientRequest ( one that doesn't change at runtime ) it's very hard to debug the state of a heap using a heapsnapshot

image

This heapsnapshot is missing the res and aborted fields. Having these fields available would make it a lot easier to reason about the state of the ClientRequest ( I have a memory leak where I am leaking outbound ClientRequest instances ).

I'm sure that this problem exists for a lot of other internal classes within the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions