Skip to content

Instantly share code, notes, and snippets.

@antic183
Last active February 3, 2026 22:01
Show Gist options
  • Select an option

  • Save antic183/5d9c062e48b8d6fa52a2274fa7fcb939 to your computer and use it in GitHub Desktop.

Select an option

Save antic183/5d9c062e48b8d6fa52a2274fa7fcb939 to your computer and use it in GitHub Desktop.
Speicherlayout eines Programms (process memory layout)
Hohe Speicheradressen
+--------------------------------------------------+
| Stack ↓ | ← wächst nach unten
| Stack Frame: foo() |
| - Rücksprungadresse → Text-Segment | ← Adresse im Programmcode, wohin return geht
| - Parameter der Funktion |
| - Lokale Variablen |
| - Zeiger/Referenzen auf Heap-Objekte | ← falls lokale Variablen Objekte referenzieren
| |
| Stack Frame: bar() |
| - Rücksprungadresse → Text-Segment |
| - Parameter |
| - Lokale Variablen |
| - Zeiger/Referenzen auf Heap-Objekte |
+--------------------------------------------------+
| Heap ↑ | ← wächst nach oben
| Objekt: obj1 |
| - Feld x = 10 |
| - Feld y = 20 |
| |
| Objekt: obj2 |
| - Feld a |
| - Feld b |
| |
| Arrays / dynamisch allokierte Daten |
+--------------------------------------------------+
| BSS | ← globale/statische Variablen (nicht initialisierte Variablen)
+--------------------------------------------------+
| Data | ← globale/statische Variablen (initialisierte Variablen)
+--------------------------------------------------+
| Text | ← Programmcode
| Funktionen / Methoden |
| Maschinencode |
+--------------------------------------------------+
Niedrige Speicheradressen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment