This talk was given at North Bay Python 2018 in Petaluma, CA.
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.
Video
Slides
Tweets
Slides for Memory Management in Python - The Basics coming up at 2:35pm at #nbpy #NorthBayPython https://t.co/pRqZLMhsr0https://t.co/EaouK9UT8O
— Nina Zakharenko 💜🐍 (@nnja) November 4, 2018
Dinner in Petaluma with my favorite Python people for #nbpy #NorthBayPython! 🐍💜 🍽️ With @mariatta @joshsimmons @chrisjrn @thursdayb @loooorenanicole @treyhunner @hayleydenb & @zooba. Can't wait for the main event tomorrow. pic.twitter.com/yMWcbI0JxL
— Nina Zakharenko 💜🐍 (@nnja) November 3, 2018
Now we have @nnja talking about memory management in Python! Slides are at https://t.co/hpuLWD9mRc #nbpy pic.twitter.com/LsDHyibXKu
— 🏳️🌈 Sam Kimbrel (@skimbrel) November 4, 2018
Implement __slots__ on your custom classes when you’re confident in their shape. They’re good for memory management and prevent monkey-patching. #nbpy @nnja pic.twitter.com/HeKyjZ0JwI
— David Gouldin (@dgouldin) November 4, 2018
Using __slots__ on your calls will make it more memory efficient because it'll use a tuple instead of a dictionary to hold its attributes. @nnja #nbpy pic.twitter.com/Ed8wWvtbM8
— Trey Hunner 🐍🍪✨ (@treyhunner) November 4, 2018
Learning about Memory management in Python from @nnja at @northbaypython #nbpy . Memory management is such a forgotten topic for most Python developers, but it is always good to have a mindset towards managing memory while writing your applications. pic.twitter.com/C3KeXGPyKs
— Vikram Bhat (@_vikrambhat1) November 4, 2018
"The GIL is here. To. Stay." @nnja #nbpy #DealWithIt
— Mariatta 🤦 (@mariatta) November 4, 2018
Here's the article @nnja mentioned about saving 9GB by using __slots__: https://t.co/slCf3up0J6 #nbpy
— Sharif Naas (@cyphase) November 4, 2018
Don’t use del because it doesn’t delete the object if you want to delete it all it does is remove the reference to that object! @nnja #NBPy pic.twitter.com/cIuvqCdDVQ
— Loooorena "La 🐯 Tigresa” @ #BLM 🖤 (@loooorenanicole) November 4, 2018
The Global Interpreter Lock makes single threaded applications fast but it means only one thread will ever by executed at a time. We've got a GIL in Python so if you want to take advantage of multiple CPU cores, use multiprocessing. @nnja #nbpy pic.twitter.com/ykPjWRnDSf
— Trey Hunner 🐍🍪✨ (@treyhunner) November 4, 2018
Wish I had seen this slide as a n00b #Pythonista all those years ago ... y’all need to scope it @nnja #NBPy chat! Super informative on #Python memory management in a very accessible way. pic.twitter.com/8T959y3blb
— Loooorena "La 🐯 Tigresa” @ #BLM 🖤 (@loooorenanicole) November 4, 2018
Memory management: in my experience you don't care until omfg you really do. Good thing @nnja is here to help 😊 #nbpy
— Scott Triglia (@scott_triglia) November 4, 2018
WOW how have I never seen a GIL -> fish gill joke in a Python talk. @nnja is boldly going where no speaker has gone before here #nbpy
— Scott Triglia (@scott_triglia) November 4, 2018
So Python uses generational garbage collection also, which is a form of tracing garbage collection.
— Trey Hunner 🐍🍪✨ (@treyhunner) November 4, 2018
(I skipped lots of slide screenshots and summarizing. You'll need to watch the talk for more.)@nnja #nbpy pic.twitter.com/Wbowq8BGbB
“don’t actually do this” slides at #nbpy: 2, now
— 🏳️🌈 Sam Kimbrel (@skimbrel) November 4, 2018
(this one was about using the ‘del’ keyword)
Now @nnja on Memory Management in #Python #NBPy weeeeee!!! Slides at https://t.co/As6C5ebIUK!! pic.twitter.com/ANCXyu0kiV
— Loooorena "La 🐯 Tigresa” @ #BLM 🖤 (@loooorenanicole) November 4, 2018
We're proud to introduce @nnja who will be presenting "Memory Management in Python - The Basics" from the stage at #nbpy 2018 this November. https://t.co/X1etC0hOTf
— North Bay Python (@northbaypython) October 17, 2018