vscode-debug-perf
v0.0.1
Published
A VS Code extension for debugging and profiling memory usage in your code. Helps identify memory leaks, analyze memory consumption patterns, and optimize memory usage.
Maintainers
Readme
vscode-debug-perf README
A VS Code extension for debugging and profiling memory usage in your code. This extension helps developers identify memory leaks, analyze memory consumption patterns, and optimize memory usage in their applications.
Features
Memory Usage Debugging
- Right-click context menu: Select any function or code block and right-click to access memory debugging options
- Real-time memory profiling: Monitor memory usage in real-time with configurable intervals
- Memory leak detection: Automatically analyze code for common memory leak patterns
- Memory optimization recommendations: Get actionable suggestions to improve memory efficiency
- Detailed memory reports: Generate comprehensive reports with memory usage statistics
Key Capabilities
- Profile memory usage of selected functions
- Track heap usage, RSS, and external memory
- Detect potential memory leaks (uncleaned intervals, event listeners, etc.)
- Execute functions with custom arguments and analyze memory impact
- Generate memory optimization recommendations
- Real-time memory monitoring with customizable intervals
- Garbage collection impact analysis
Usage
- Select code: Highlight the function or code block you want to analyze
- Right-click: Open the context menu
- Choose "Debug Memory Usage": Select from the available options:
- Execute Function and Profile Memory: Run function with custom arguments and analyze memory impact
- Analyze Function for Memory Issues (Static): Static analysis of code for memory patterns
- Start Global Memory Profiling: Begin real-time memory monitoring
- Stop Global Memory Profiling: End profiling and view summary
Requirements
- VS Code 1.100.0 or higher
- Node.js environment (for memory profiling APIs)
Extension Settings
This extension contributes the following settings:
vscode-debug-perf.defaultProfilingInterval: Default interval (in milliseconds) for memory profiling (default: 100ms)vscode-debug-perf.autoGenerateReports: Automatically generate memory reports after profiling sessionsvscode-debug-perf.showMemoryWarnings: Display warnings for potential memory issues in code
Commands
Debug Memory Usage: Available in the right-click context menu when text is selectedDebug Performance: General performance debugging command
Output Channels
The extension creates the following output channels:
- Function Execution & Memory Profile: Detailed analysis of executed functions with memory profiling
- Function Static Analysis: Static code analysis for memory issues
- Memory Profiler: Real-time memory usage data
Known Issues
- Memory profiling is limited to the VS Code extension host process
- Garbage collection analysis requires VS Code to be started with --expose-gc flag
- Real-time profiling may impact performance on slower systems
Release Notes
1.0.0
Initial release with memory debugging capabilities:
- Right-click context menu for memory debugging
- Real-time memory profiling
- Memory leak detection
- Optimization recommendations
- Detailed memory reports
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\on macOS orCtrl+\on Windows and Linux). - Toggle preview (
Shift+Cmd+Von macOS orShift+Ctrl+Von Windows and Linux). - Press
Ctrl+Space(Windows, Linux, macOS) to see a list of Markdown snippets.
For more information
Enjoy!
