2014-10-31 22:21:37 +00:00
|
|
|
:mod:`gc` -- control the garbage collector
|
|
|
|
==========================================
|
2014-10-31 01:37:19 +00:00
|
|
|
|
|
|
|
.. module:: gc
|
|
|
|
:synopsis: control the garbage collector
|
|
|
|
|
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
2014-10-31 21:30:46 +00:00
|
|
|
.. function:: enable()
|
2014-10-31 01:37:19 +00:00
|
|
|
|
2014-10-31 21:30:46 +00:00
|
|
|
Enable automatic garbage collection.
|
2014-10-31 01:37:19 +00:00
|
|
|
|
|
|
|
.. function:: disable()
|
|
|
|
|
2014-10-31 21:30:46 +00:00
|
|
|
Disable automatic garbage collection. Heap memory can still be allocated,
|
|
|
|
and garbage collection can still be initiated manually using :meth:`gc.collect`.
|
2014-10-31 01:37:19 +00:00
|
|
|
|
2014-10-31 21:30:46 +00:00
|
|
|
.. function:: collect()
|
2014-10-31 01:37:19 +00:00
|
|
|
|
2014-10-31 21:30:46 +00:00
|
|
|
Run a garbage collection.
|
2014-10-31 01:37:19 +00:00
|
|
|
|
|
|
|
.. function:: mem_alloc()
|
|
|
|
|
|
|
|
Return the number of bytes of heap RAM that are allocated.
|
|
|
|
|
2017-06-24 11:12:09 +01:00
|
|
|
.. admonition:: Difference to CPython
|
|
|
|
:class: attention
|
|
|
|
|
|
|
|
This function is MicroPython extension.
|
|
|
|
|
2014-10-31 01:37:19 +00:00
|
|
|
.. function:: mem_free()
|
|
|
|
|
2017-06-24 11:12:09 +01:00
|
|
|
Return the number of bytes of available heap RAM, or -1 if this amount
|
|
|
|
is not known.
|
|
|
|
|
|
|
|
.. admonition:: Difference to CPython
|
|
|
|
:class: attention
|
|
|
|
|
|
|
|
This function is MicroPython extension.
|