📦 Sonstige & Niche
Memory Profiler CLI
Beispiel-Ausgaben
So antworten ChatGPT, Claude und Gemini typischerweise auf diesen Prompt:
I'll help you create a memory profiling tool in C with the features you've specified. The implementation will use ptrace() for process attachment, malloc hooks for allocation tracking, and libunwind for stack traces. For the CLI, we'll use getopt_long() for argument parsing and implement an interactive mode with commands like 'snapshot', 'diff', and 'report'. The tool will support JSON, CSV, and human-readable output formats, with configurable thresholds to filter out small allocations.
This is a substantial systems programming project that requires careful consideration of several tradeoffs. Process attachment via ptrace() can introduce overhead, so you'll want to implement selective tracing. For allocation tracking, interposing malloc/free is more reliable than hooking, though it limits you to dynamic linking scenarios. Stack trace collection with libunwind adds significant overhead—consider making it optional or sampling-based for production use.
A C-based memory profiler would typically use LD_PRELOAD to intercept malloc/free calls, ptrace for external process attachment, and libraries like libunwind or libbacktrace for stack traces. Key implementation concerns include thread-safety (use pthread mutexes around tracking structures), minimal overhead (ring buffers for event logging), and proper signal handling (SIGINT, SIGTERM) for graceful shutdown. Popular tools like Valgrind's massif and heaptrack demonstrate effective approaches to heap profiling and leak detection.
So nutzt du diesen Prompt
Kopiere den Prompt oben oder klicke einen "Öffnen in"-Button um ihn direkt in deiner bevorzugten KI zu starten. Du kannst den Text dann an deinen Anwendungsfall anpassen — z.B. Platzhalter wie [dein Thema] durch echten Kontext ersetzen.
Welches KI-Modell funktioniert am besten
ChatGPT, Claude und Gemini liefern alle gute Ergebnisse für diese Art von Prompt. Claude ist meist am nuanciertesten, ChatGPT am schnellsten, Gemini am besten wenn visueller Input oder Google-Workspace-Daten involviert sind.
Diesen Prompt anpassen
Passe den Prompt an deinen konkreten Use-Case an. Ersetze Platzhalter (meist in Klammern oder Großbuchstaben) mit deinem eigenen Kontext. Je mehr Details du lieferst, desto präziser die Antwort.
Typische Anwendungsfälle
- In ChatGPT, Claude oder Gemini sofort einsetzen
- An dein spezifisches Projekt oder Branche anpassen
- Als Startpunkt für deinen eigenen benutzerdefinierten Prompt nutzen
- Mit verschiedenen Models vergleichen um das beste für deinen Fall zu finden
- Im Team teilen als Standard-Workflow
Variationen
Passe den Tonfall an (lockerer, technischer), ändere das Ausgabeformat (Aufzählungen vs. Absätze) oder füge Einschränkungen hinzu (Wortlimits, Zielgruppe).