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

Tools for tracking memory "leaks" #38

Closed
hadley opened this issue Jun 7, 2019 · 1 comment
Closed

Tools for tracking memory "leaks" #38

hadley opened this issue Jun 7, 2019 · 1 comment

Comments

@hadley
Copy link
Member

hadley commented Jun 7, 2019

obj_size() provides the basic structure for the recursion. The main difference would be that each call returns a nested list containing the current object, and a (potentially named) list of its children. Would want options to control the maximum depth to recurse (so you could explore iteratively, if needed), whether or not to show CHARSXPs, and how to handle ALTREP. By default, would show environments in the same way as lists, rather than exposing the details of their internal hash tables (but needs option to show full details for debugging other code).

Need small S3 class to capture an object — it's address (string), type (string), NAMED (integer?), and id (integer, if seen before, NULL otherwise), and its children (named list). Its print method would take care of generating the tree display.

This would effectively become a replacement for .Internal(inspect(x)), with a better display (i.e. using colour and unicode tree characters) and displaying a spanning tree (instead of potentially getting stuck in infinite loops). Would replace internal obj_formals() etc, and altrep().

@hadley
Copy link
Member Author

hadley commented Jun 10, 2019

@hadley hadley closed this as completed in 393a58b Jun 11, 2019
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

No branches or pull requests

1 participant