Entwickle ein Speicher-Profiling-Tool in C zur Analyse der Speichernutzung von Prozessen. Implementiere das Anhängen an Prozesse mit minimalen Auswirkungen auf die Leistung. Ergänze Heap-Analyse mit Verfolgung von Allokationen, Erkennung von Speicherlecks mit Stack-Traces und eine Kommandozeilenschnittstelle mit interaktivem Modus.
Diese Uebersetzung dient nur dem Verstaendnis. Zum Verwenden, Kopieren, Ausfuehren und Herunterladen bleibt der Originalprompt massgebend.
Entwickle ein Werkzeug zur Analyse der Speichernutzung von Prozessen. Es soll sich an Prozesse anhängen, ohne die Leistung stark zu beeinträchtigen. Zusätzlich sollen Heap-Analyse, Speicherleck-Erkennung mit Stack-Traces und eine Kommandozeilenschnittstelle mit interaktivem Modus enthalten sein.
Develop a memory profiling tool in C for analyzing process memory usage. Implement process attachment with minimal performance impact. Add heap analysis with allocation tracking. Include memory leak detection with stack traces. Implement memory usage visualization with detailed statistics. Add custom allocator hooking for detailed tracking. Include report generation in multiple formats. Implement filtering options for noise reduction. Add comparison functionality between snapshots. Include command-line interface with interactive mode. Implement signal handling for clean detachment.