Tags: facebook/memlab
Tags
fix(core): set the max depth for object structural traversal when ser… …ializing leak traces Summary: To limit the maximum size of the serialized JSON representation of the memory leak trace, this diff introduces two configuration options that constrain both the breadth and depth during serialization: * When serializing each node (object) in the leak trace, only up to the configured number of outgoing references (edges) are included. * The recursive serialization via `JSONifyNode` is capped at the configured maximum depth into the object graph. Differential Revision: D74195874 fbshipit-source-id: cbc632643cef0729a77009deff779680dbad1f96
feat(core): support console annotations (#124) Summary: When dev set the following config, we want stack traces to be printed even if `lowLevel` output is muted (stack traces is output at `lowLevel` for various reasons such as coloring, but semantically it is part of the error output). ``` memlabConfig.muteConfig = { muteError: false, muteWarning: false, muteInfo: true, muteSuccess: true, muteLog: true, muteTable: true, muteTrace: true, muteTopLevel: true, muteHighLevel: true, muteMidLevel: true, muteLowLevel: true, }; memlabConfig.verbose = true; ``` This diff patches the MemLab console output module so that stack traces is still printed when `muteLowLevel` is `true` while `muteError` is `false`. Differential Revision: D63012111 fbshipit-source-id: 535bde1a3e7287a2d5b33c75f48b04f708a44be8
Add JSON output parameter to more analyses (#129) Summary: Added `OutputOption` to a few more analyses, as the `printNodeListInTerminal` method supports JSON output. Pull Request resolved: #129 Reviewed By: twobassdrum Differential Revision: D61780561 Pulled By: JacksonGL fbshipit-source-id: 28c3f55459f2ad1a04cfcbb7861e74fa5c3e5d22
JSON output (#128) Summary: PR changes: * Adds `--output [text/json]` CLI option which sets the `outputFormat` config flag * When output is set to JSON, it implies the `--sc` option and directs all logs to `stderr`. This allows to easily capture a clean JSON output using `memlab > result.json`. * Adds `getJSONifyableObject` to the interfaces of nodes and edges * Updates `printNodeListInTerminal` and `printReferencesInTerminal` to support JSON output * Updates `CollectionsHoldingStaleAnalysis` to support JSON output Open questions: * Should all analyses support JSON output? I only added the ones I need at the moment. * The output from `getJSONifyableObject` has inconsistent casing (e.g. snake `self_size` vs. camel `incomingEdgeCount`). Is it a breaking change to change this so it's all the same? Which case is preferrred? Fixes #127 Pull Request resolved: #128 Reviewed By: twobassdrum Differential Revision: D61724639 Pulled By: JacksonGL fbshipit-source-id: 13a056be1c421999ffbd988ee5f85026d66c860d
feat(core): support for console mute configuration (#124) Summary: OSS feature request: #124 By setting `config.muteConfig`, JS code using MemLab API can set the mute config for different types of console messages (e.g., warning, error etc.) ``` type MuteConfig = { muteError?: boolean; muteWarning?: boolean; muteInfo?: boolean; muteSuccess?: boolean; muteLog?: boolean; muteTable?: boolean; muteTrace?: boolean; muteTopLevel?: boolean; muteHighLevel?: boolean; muteMidLevel?: boolean; muteLowLevel?: boolean; }; ``` Reviewed By: twobassdrum Differential Revision: D61287025 fbshipit-source-id: cb0d8b3a06d3f80d61ad107d0d41a633d8e69307
fix(core): simplify serialization for code heap object (#122) Summary: MemLab could run out of memory if the JS heap under analysis has complex code heap objects (i.e., JS interpreted, and compiled code representation and their context graph in heap) which may take a lot of time and memory to serialize: #122 This diff fixes this issue by simplifying the code heap object serialization process and output. Reviewed By: tulga1970 Differential Revision: D59541476 fbshipit-source-id: a4eb00e0f914d4694a1fe562abe0c861ca641ad1
PreviousNext