An open API service indexing awesome lists of open source software.

https://github.com/kporus/gc-visualizer


https://github.com/kporus/gc-visualizer

inspect psutil python streamlit

Last synced: 25 days ago
JSON representation

Awesome Lists containing this project

README

          

# ๐Ÿงน Python GC Visualizer

An interactive tool to understand and experiment with Python's built-in garbage collection (GC) system โ€” especially how it handles **circular references** and unreachable objects.

Built using **Streamlit**, this educational tool helps visualize and debug memory management behavior in real time.

---

## ๐Ÿš€ Features

* โœ… Create Python objects with or without circular references
* ๐Ÿงผ Force garbage collection manually
* ๐Ÿ“Š View memory usage and unreachable object count
* ๐Ÿ” Toggle circular references to simulate GC edge cases
* ๐Ÿง  Show internal GC debug statistics
* ๐Ÿ“ฆ Live summary of object types in memory

---

## ๐Ÿงช Usage

1. **Launch app locally**:

```bash
streamlit run app.py
```

2. **Explore buttons**:

* Create and delete objects
* Toggle circular references
* Force GC and monitor behavior

3. **Understand output**:

* See how memory usage changes
* Discover how many objects GC can reclaim
* Use object type summary to detect object leaks

---

## ๐Ÿ“ธ Screenshots

> (You can add screenshots here after running it!)
![alt text](image.png)

---

## ๐Ÿง  What You'll Learn

* How Python tracks and reclaims memory
* Why circular references need a GC (not just reference counting)
* How to analyze memory behavior using `gc`, `psutil`, and `inspect`

---

## ๐Ÿ› ๏ธ Tech Stack

* **Python 3.9+**
* **Streamlit** โ€” for the interactive frontend
* **gc**, **psutil**, **inspect** โ€” for memory analysis

---

## ๐Ÿ“„ License

MIT โ€” use freely and learn boldly!