Fix Memory Leak in Application
Advanced AI prompt for debugging memory leaks. Get step-by-step analysis, tools, and solutions to identify and resolve memory issues.
Prompt Template
Variables to Customize
[PROGRAMMING_LANGUAGE] The programming language of your application
Example: JavaScript (Node.js)
[FRAMEWORK] Framework or runtime environment being used
Example: Express.js with MongoDB
[APPLICATION_TYPE] Type of application experiencing the memory leak
Example: REST API server handling file uploads
[ENVIRONMENT] Environment where the leak occurs
Example: Production Linux server with 8GB RAM
[SYMPTOMS] Observable symptoms of the memory leak
Example: Memory usage grows from 200MB to 2GB over 6 hours, server crashes with out-of-memory errors
[CODE_SNIPPET] Relevant code that might be causing the leak
Example: app.post('/upload', upload.single('file'), async (req, res) => { /* file processing code */ })
[MEMORY_PATTERNS] Any patterns noticed in memory usage
Example: Memory spikes during file upload operations, garbage collection not freeing memory effectively
Example Output
Pro Tips for Best Results
- Always provide specific error messages, memory usage numbers, and timing information for more accurate diagnosis
- Include relevant code snippets, especially around resource allocation and cleanup operations
- Mention your monitoring setup and any profiling tools already tried to avoid duplicate suggestions
- Specify the scale of your application (concurrent users, file sizes, etc.) to get appropriately scaled solutions
- Follow up with specific questions about recommended tools or implementation details for clarification
Tags
Want 500+ Expert Prompts?
Get the Premium Prompt Pack — organized, tested, and ready to use.
Get it for $29Related Prompts You Might Like
Write Professional Git Commit Messages
You are a Git expert who writes clear, professional commit messages that follow industry best practices. I need you to g...
Write Professional API Documentation
You are a technical documentation specialist tasked with creating comprehensive API documentation for [API_NAME]. Create...
Convert JavaScript to TypeScript
You are an expert TypeScript developer tasked with converting JavaScript code to TypeScript. Please convert the followin...
Refactor Legacy Code for Modern Standards
You are a senior software architect specializing in legacy code modernization. I need you to refactor the following [PRO...
Implement Rate Limiting for APIs
You are an expert backend engineer specializing in API security and performance optimization. I need you to implement a ...
Create Comprehensive Database Backup Strategy
You are a senior database administrator with expertise in enterprise backup strategies and disaster recovery planning. C...