Telegram Group & Telegram Channel
✔️ Как работает механизм garbage collection в Python, и какие алгоритмы используются для управления памятью?

🗑 В Python используется автоматическое управление памятью с помощью механизма garbage collection (GC). Основной алгоритм, который применяется для этого, — это reference counting (подсчёт ссылок). Каждый объект в Python имеет счётчик ссылок, который увеличивается, когда на объект создаётся новая ссылка, и уменьшается, когда ссылка удаляется. Когда счётчик ссылок достигает нуля, память, занимаемая объектом, освобождается.

🚮 Кроме reference counting, Python также использует циклический garbage collector (из модуля gc), который обнаруживает и удаляет циклические ссылки (когда объекты ссылаются друг на друга, но больше не доступны извне). Этот сборщик мусора работает на основе алгоритма generational garbage collection, который разделяет объекты на поколения (young, middle, old) и чаще проверяет молодые объекты, так как они с большей вероятностью становятся мусором.

Библиотека собеса по Python
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/py_interview_lib/756
Create:
Last Update:

✔️ Как работает механизм garbage collection в Python, и какие алгоритмы используются для управления памятью?

🗑 В Python используется автоматическое управление памятью с помощью механизма garbage collection (GC). Основной алгоритм, который применяется для этого, — это reference counting (подсчёт ссылок). Каждый объект в Python имеет счётчик ссылок, который увеличивается, когда на объект создаётся новая ссылка, и уменьшается, когда ссылка удаляется. Когда счётчик ссылок достигает нуля, память, занимаемая объектом, освобождается.

🚮 Кроме reference counting, Python также использует циклический garbage collector (из модуля gc), который обнаруживает и удаляет циклические ссылки (когда объекты ссылаются друг на друга, но больше не доступны извне). Этот сборщик мусора работает на основе алгоритма generational garbage collection, который разделяет объекты на поколения (young, middle, old) и чаще проверяет молодые объекты, так как они с большей вероятностью становятся мусором.

Библиотека собеса по Python

BY Библиотека собеса по Python | вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/py_interview_lib/756

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

What Is Bitcoin?

Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

telegram from us


Telegram Библиотека собеса по Python | вопросы с собеседований
FROM USA