Run garbage collection and optionally trim glibc malloc arenas. Args: trim: If True, call malloc_trim(0) to return freed memory to the OS.
(trim: bool = False)
| 85 | |
| 86 | @staticmethod |
| 87 | def _collect_memory(trim: bool = False): |
| 88 | """Run garbage collection and optionally trim glibc malloc arenas. |
| 89 | |
| 90 | Args: |
| 91 | trim: If True, call malloc_trim(0) to return freed memory to the OS. |
| 92 | """ |
| 93 | gc.collect() |
| 94 | if trim: |
| 95 | _malloc_trim(0) |
| 96 | |
| 97 | @staticmethod |
| 98 | def _clear_message_buffers(messages): |
no test coverage detected