Mar-15-2019, 01:58 AM
(This post was last modified: Mar-15-2019, 01:58 AM by AlekseyPython.)
(Mar-14-2019, 09:41 AM)Larz60+ Wrote:Quote:Why does garbage collection not start independently, but only after calling the collect() method?Python schedules garbage collection automatically. You don't have to call collect.
I've written many thousands of lines of python code, and haven't been concerned in the least about garbage collection.
It's always performed as stated and has never caused a problem for me.
if I don't call gc.collect() method __del__, which writing accumulated data in my database, not performed. But if I call it, then method __del__ calling and data writing successfully. This is evident not only by the debugger, but also by the presence of records in the database.