Python: gc.get_threshold() - Python Glossary

Published: 11 March 2015
on channel: Code master
525
5

gc.get_threshold(threshold0, threshold1, threshold2)

You will see three numbers returned to us and these numbers are set at three different runs of the garbage collection. First one is ran when the allocations minus the deallocations exceed the number displayed.Default for threshold0 is 700. If the object survives the first run it is relocated into the second run. The second number returned to us is when the second garbage collection will run this is threshold1 of garbage collection this number is based on the number runs that threshold0 does. The succeeding generation default is 10 so in this case threshold0 run must run ten times before the threshold1 of garbage collection is ran. If an object survives the subsequent run it is now moved into the third and final run and the object will stay here until it is removed. Threshold2 will run based off threshold1 runs. The default is 10 threshold1 runs. So, when the threshold1 runs ten times the final generation will run.


On this page of the site you can watch the video online Python: gc.get_threshold() - Python Glossary with a duration of hours minute second in good quality, which was uploaded by the user Code master 11 March 2015, share the link with friends and acquaintances, this video has already been watched 525 times on youtube and it was liked by 5 viewers. Enjoy your viewing!