मराठी

Differentiate between reference counting and automatic garbage collection with respect to Python.

Advertisements
Advertisements

प्रश्न

Differentiate between reference counting and automatic garbage collection with respect to Python.

फरक स्पष्ट करा
Advertisements

उत्तर

Basis of Difference Reference Counting Automatic Garbage Collection
Basis Counts the number of references pointing to an object. Runs according to allocation and de-allocation thresholds.
Object deletion Object is reclaimed immediately when its reference count becomes zero. Unreachable objects are reclaimed when the garbage collector runs.
Cyclic references Cannot independently reclaim objects involved in a reference cycle. Can detect and reclaim many cyclically referenced unreachable objects.
Execution Continuous during program execution as references change. A scheduled/background activity of Python's garbage collector.
Example del x may reduce an object's reference count. A self-referencing list can be collected by the cyclic garbage collector.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: Classes in Python - EXERCISE [पृष्ठ ६२]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
पाठ 3 Classes in Python
EXERCISE | Q 12. | पृष्ठ ६२
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×