Conversation
Notices
-
Embed this notice
The MILF Messiah (lunarised@whinge.town)'s status on Tuesday, 16-Apr-2024 11:23:58 JST The MILF Messiah @karna @teknomunk @binkle @charliebrownau @hazlin what is the sam hell is this alarmist hogwash :o -
Embed this notice
charliebrownau (charliebrownau@poa.st)'s status on Tuesday, 16-Apr-2024 11:23:59 JST charliebrownau @teknomunk @binkle @karna @hazlin Python
Rust
SystemD
All a subversion weapon -
Embed this notice
karna :flipflop: :buffsuki: (karna@poa.st)'s status on Tuesday, 16-Apr-2024 11:23:59 JST karna :flipflop: :buffsuki: @charliebrownau @teknomunk @binkle @hazlin So true, let's all use plan9
-
Embed this notice
hazlin no plap pirate (hazlin@shortstacksran.ch)'s status on Tuesday, 16-Apr-2024 11:24:01 JST hazlin no plap pirate @karna @binkle huh, I had assumed that, reference counting meant that you didn't have a separate gc event.
For example, every time you deference, and there for, decrement the counter, there was a check to see if it was zero. -
Embed this notice
karna :flipflop: :buffsuki: (karna@poa.st)'s status on Tuesday, 16-Apr-2024 11:24:01 JST karna :flipflop: :buffsuki: @hazlin @binkle I'll be honest, I'm getting out of my depth but I would assume there is a deallocation when the reference count of an object hits 0 it would be deallocated (assuming no cyclical references) but this is python, so for all I know the deallocations of objects with 0 reference counts might be queued up and done at certain moments. The gc.collect call is more to try and force collection of objects that have cyclical references that may no longer be valid references (look up generational thresholds or variations of that alongside python to find more info on that)
-
Embed this notice
teknomunk (teknomunk@apogee.polaris-1.work)'s status on Tuesday, 16-Apr-2024 11:24:01 JST teknomunk @karna @binkle @hazlin
Going to drop in here to give what I know about the subject. I don't have any particular insight into python.
When using referencing counting, you can release the memory to the allocator as soon as they reach zero references or you can queue them up for later releasing. This works reasonably well, but as you pointed out: cycles exist and make reference counting fail.
A tracing garbage collector is one of the solutions for automaticly releasing memory that is no longer needed. It traces the graph of every memory allocation that is still reachable from global variables and the stack and marks everything that is reachable and throws away everything else.
As I under it, python mostly uses reference counting, but falls back to a tracing garbage collector for dealing with cycles. -
Embed this notice
karna :flipflop: :buffsuki: (karna@poa.st)'s status on Tuesday, 16-Apr-2024 11:24:02 JST karna :flipflop: :buffsuki: @binkle @hazlin Such is life in the carnival of horrors that is python. Im not going to get into the details but roughly speaking theres reference counting being done to inform the automatic garbage collection, but when that isn't suitable (think reference cycles, the collector not being called soon enough when left to its own devices, etc.), you could, for example, do some simple manual garbage collection by calling the python's garbage collector manually (hence manual garbage collection)
import gc gc.collect() # or disable it entirely with gc.disable()PS I hate python
-
Embed this notice
hazlin no plap pirate (hazlin@shortstacksran.ch)'s status on Tuesday, 16-Apr-2024 11:24:03 JST hazlin no plap pirate @karna @binkle that worked!
I didn't know del was a thing in python... -
Embed this notice
karna :flipflop: :buffsuki: (karna@poa.st)'s status on Tuesday, 16-Apr-2024 11:24:03 JST karna :flipflop: :buffsuki: @hazlin @binkle Trust me when I say manual garbage collection in python is not a fun rabbit hole, especially venturing beyond del
-
Embed this notice
binkle (binkle@clubcyberia.co)'s status on Tuesday, 16-Apr-2024 11:24:03 JST binkle @karna @hazlin coming from a world where C/C++ is the norm, something about the phrase "manual garbage collection" makes my skin itch -
Embed this notice
hazlin no plap pirate (hazlin@shortstacksran.ch)'s status on Tuesday, 16-Apr-2024 11:24:04 JST hazlin no plap pirate @karna @binkle ahhh, that killed the last value feature in my long running RPEL xD -
Embed this notice
karna :flipflop: :buffsuki: (karna@poa.st)'s status on Tuesday, 16-Apr-2024 11:24:04 JST karna :flipflop: :buffsuki: @hazlin @binkle Doesnt it get reassigned after your next assignment? Or maybe you need to do
del _?
-
Embed this notice
hazlin no plap pirate (hazlin@shortstacksran.ch)'s status on Tuesday, 16-Apr-2024 11:24:05 JST hazlin no plap pirate @binkle
def binkle_function(**args):
>>>pass -
Embed this notice
karna :flipflop: :buffsuki: (karna@poa.st)'s status on Tuesday, 16-Apr-2024 11:24:05 JST karna :flipflop: :buffsuki: @hazlin @binkle def _(**kwargs): ... -
Embed this notice
binkle (binkle@clubcyberia.co)'s status on Tuesday, 16-Apr-2024 11:24:06 JST binkle an entire day devoted to finding out "yeah no this function does nothing and it never will" :pleadhelp:
-
Embed this notice