垃圾回收 永生代

Posted yuanjiangw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了垃圾回收 永生代相关的知识,希望对你有一定的参考价值。

https://docs.python.org/3/library/gc.html#module-gc
gc.freeze()

Freeze all the objects tracked by gc - move them to a permanent generation and ignore all the future collections. This can be used before a POSIX fork() call to make the gc copy-on-write friendly or to speed up collection. Also collection before a POSIX fork() call may free pages for future allocation which can cause copy-on-write too so it’s advised to disable gc in master process and freeze before fork and enable gc in child process.

New in version 3.7.

gc.unfreeze()

Unfreeze the objects in the permanent generation, put them back into the oldest generation.

New in version 3.7.

gc.get_freeze_count()

Return the number of objects in the permanent generation.

以上是关于垃圾回收 永生代的主要内容,如果未能解决你的问题,请参考以下文章

永久代退出舞台,元空间腾空出世

永久代退出舞台,元空间腾空出世

第三章:回收方法区

Java 垃圾回收 - 收集算法

29垃圾分代回收机制

垃圾回收算法分代回收