https://github.com/themusharraf/python-memory-managment
VARIABLES & MEMORY MANAGEMENT EXAMPLE
https://github.com/themusharraf/python-memory-managment
advanced-programming ctypes garbage-collection memory memory-management python
Last synced: 10 months ago
JSON representation
VARIABLES & MEMORY MANAGEMENT EXAMPLE
- Host: GitHub
- URL: https://github.com/themusharraf/python-memory-managment
- Owner: themusharraf
- Created: 2024-06-10T10:46:38.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T16:15:01.000Z (almost 2 years ago)
- Last Synced: 2024-09-10T18:08:52.509Z (almost 2 years ago)
- Topics: advanced-programming, ctypes, garbage-collection, memory, memory-management, python
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VARIABLES & MEMORY MANAGEMENT
### 1. [Garbage Collection](https://github.com/themusharraf/Python-memory-managment/blob/master/garbage_c.py)
### 2. [References](https://github.com/themusharraf/Python-memory-managment/blob/master/references.py)
### 3. [Dynamic Typing](https://github.com/themusharraf/Python-memory-managment/blob/master/dynamic_type.py)
### 4. [Mutable and Immutable](https://github.com/themusharraf/Python-memory-managment/blob/master/mutable_Immutable.py)
### 5. [Python is operator](https://github.com/themusharraf/Python-memory-managment/blob/master/is_operator.py)
### 6. [Python None](https://github.com/themusharraf/Python-memory-managment/blob/master/none_not_is.py)
[Garbage Collection](https://github.com/themusharraf/Python-memory-managment/blob/master/garbage_c.py) Python’da avtomatik xotira boshqaruvi va chiqindilarni tozalash mexanizmini ko’rsatadi. Kodda ctypes moduli yordamida obyektlarning xotira manzillari orqali ular ustida ishlash va chiqindilarni tozalash (garbage collection) yoqilgan va o’chirilgan holatda obyektlar mavjudligini tekshirish amalga oshiriladi.
## Funksiyalar
- `ref_count(address)`: Bu funksiya ko’rsatilgan xotira manzilidagi obyektning foydalanish sonini qaytaradi.
- `object_exists(object_id)`: Bu funksiya ko’rsatilgan obyekt identifikatori (ID) bo’yicha obyekt mavjudligini tekshiradi.
## Sinflar
- `A`: Bu sinf B sinfidan obyektni yaratadi va undan nusxa oladi.
- `B`: Bu sinf A sinfidan obyektni yaratadi va undan nusxa oladi.
## Chiqindilarni tozalash
- `gc.disable()`: Chiqindilarni tozalash mexanizmini o'chiradi.
- `gc.collect()`: Chiqindilarni tozalash mexanizmini qo'lda chaqiradi.