Nina Zakharenko - Memory Management in Python - The Basics - PyCon 2016

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • Speaker: Nina Zakharenko
    As a new python developer, do you find memory management in Python confusing? Come to this talk to learn about the basics of how Memory Management works in Python. We'll cover the concepts of reference counting, garbage collection, weak references, __slots__, and the Global Interpreter Lock.
    Slides can be found at: speakerdeck.com/pycon2016 and github.com/PyCon/2016-slides

ความคิดเห็น • 45

  • @Jitsusama
    @Jitsusama 7 ปีที่แล้ว +45

    That might be the best explanation of garbage collection basics that I've ever seen. Thanks!

  • @PyMoondra
    @PyMoondra 5 ปีที่แล้ว +13

    One of the better talks I have seen on the GC basics.

  • @ptbraju111
    @ptbraju111 7 ปีที่แล้ว +10

    Great Talk, really wort watching. Thanks Nina

  • @aslamsaidu944
    @aslamsaidu944 7 ปีที่แล้ว +2

    Really great work. Thank you so much.

  • @bjugdbjk
    @bjugdbjk 5 ปีที่แล้ว +4

    Great talk,lot of insights

  • @slowcoding
    @slowcoding 5 ปีที่แล้ว +2

    Big complements. What an excellent explanation!!!

  • @nikitasid4947
    @nikitasid4947 7 ปีที่แล้ว +1

    Great talks you make, thanks.

  • @ivaneresko4416
    @ivaneresko4416 5 ปีที่แล้ว

    Хорошо рассказывает! Многое для себя почерпнул

  • @ShovraDas
    @ShovraDas 4 ปีที่แล้ว +1

    Great job. Thanks!

  • @vanglequy7844
    @vanglequy7844 5 ปีที่แล้ว +6

    She could deliver quite a lot of information after this 27 minute talk. And it is clear what she is presenting. Many other talks went on for an hour or more but did not deliver much, only smokescreen.

  • @joepesci5845
    @joepesci5845 6 ปีที่แล้ว +1

    Fantastic!

  • @siddaramhalli
    @siddaramhalli 3 ปีที่แล้ว +1

    What an explaination .. Thanks

  • @samaryadav7208
    @samaryadav7208 6 ปีที่แล้ว +4

    I love how she is enjoying her own talk. The best talk on gc.

  • @ozkaa
    @ozkaa 6 ปีที่แล้ว +2

    super useful thankyou

  • @deepakbhardwaj9543
    @deepakbhardwaj9543 2 ปีที่แล้ว

    Very Informative! @Thanks

  • @darrylsaldanha9401
    @darrylsaldanha9401 5 ปีที่แล้ว +1

    Great! Thx!

  • @orangleliu2967
    @orangleliu2967 7 ปีที่แล้ว +1

    太棒了!解释的非常通俗易懂

  • @fucaizhu6531
    @fucaizhu6531 4 ปีที่แล้ว

    How to detect a cycle is done in python garbage collection loop? Outside refcount equal to 0?

  • @sisyphus_619
    @sisyphus_619 7 ปีที่แล้ว +5

    That was very understandable.

  • @danlan4132
    @danlan4132 7 ปีที่แล้ว

    Nice explaniation of None and del, I know what I should do now, I should use NONE instead of del?

  • @RazikhShaik19
    @RazikhShaik19 5 ปีที่แล้ว

    8:16 In python 3.6.4 ID are different now, any explanation? when assigned y = x then id are same!

    • @_cytosine
      @_cytosine 4 ปีที่แล้ว +1

      Don't try it within the REPL but within a real python program.

  • @syw4049
    @syw4049 5 ปีที่แล้ว

    Why is python garbage collection were limited by GIL (prevent reference count happen concurrently) while C# has also garbage collection mechanism but it's still able to perform multithreading ?

  • @kartikeysingh9764
    @kartikeysingh9764 4 ปีที่แล้ว

    When she says when a thread tries to decrease the refCount and another thread tries to increase the refCount simultaneously, is it somewhat similar to deadlock?

    • @adityasethi9794
      @adityasethi9794 2 ปีที่แล้ว

      It can lead to race condition. Addition and subtraction are not atomic. Let's say ref count is 2. Now thread 1 reads that ref and subtracts by 1. Now before it could subtract and save it got preempted. Now 2nd thread runs and reads the ref count as 2. Now you can see where the problem is. 1st thread had already reduced count from 2 to 1 but just couldn't save it. Thread 2 read an old value of ref count. Ideally after both threads are done ref count should be 0. But in above scenario it will be 1. Thread safe means only single thread can operate at a time so that such cases are prevented.
      This is not deadlock.

  • @nikilkvn
    @nikilkvn 5 ปีที่แล้ว

    I did not understand the cascading effect of del? can someone explain

    • @kartikeysingh9764
      @kartikeysingh9764 4 ปีที่แล้ว +2

      Let's say if the object whose refCount is becoming 0 points to another object with refCount 1 and so on... all those pointed objects refCount become zero like in a cascade. (falling of dominoes)

  • @ahmedhodhod7332
    @ahmedhodhod7332 3 ปีที่แล้ว +1

    Slides : speakerdeck.com/nnja/nina-zakharenko-the-basics-of-memory-management-in-python-north-bay-python-2018?slide=5

  • @vvkkumar3691
    @vvkkumar3691 7 ปีที่แล้ว

    Hi Nina,
    Duration: 12.19
    what is node1 and node2?

    • @JaikratSinghTariyal
      @JaikratSinghTariyal 6 ปีที่แล้ว

      Left Child and Right Child.

    • @anilaxsus6376
      @anilaxsus6376 6 ปีที่แล้ว

      well, i dont know i she explained the node well, imagine a horizontal line with a circle at each end of the line, and one circle at the center of the line, this means there are 3 circles, each of these circles is like the node nina was talking about, the node (circle) to the left end of the line only has one node next to it (or connected to it) which is the node(circle) at the middle of the line. Now lets look at the circle(node) at the middle of the line, this middle circle(or node) has 1 circle(or node) on its left and another circle(node) on its right, so both the left and right node(or circle) are next to the middles circle(node)

  • @stevenzayas5527
    @stevenzayas5527 3 ปีที่แล้ว

    20:13

  • @fdama
    @fdama 8 ปีที่แล้ว

    Hi

  • @MrWorshipMe
    @MrWorshipMe 3 ปีที่แล้ว

    RAII is a better pattern than garbage collection.

  • @gJonii
    @gJonii 4 ปีที่แล้ว +3

    She's using such confused examples. It's painful to watch since pretty much all I know about this topic beforehand lead me to be either suspicious of her claims due to small inaccuracies, or just stuff I know with absolute certainty to be just total bollocks.
    I don't understand who is the target audience here. But it just seems super frustrating to see misinformation spread with such confidence.

    • @gsb22
      @gsb22 3 ปีที่แล้ว +1

      +1

    • @rahuldamineni8840
      @rahuldamineni8840 2 ปีที่แล้ว +1

      What do you mean? Can you point out a few mistakes?

  • @RubenKelevra
    @RubenKelevra 7 ปีที่แล้ว +2

    She even talks slow speed up 25% ... what a boring talk too - I thought that would be interesting :/