|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +from pyarrow.lib import _Weakrefable |
| 19 | + |
| 20 | + |
| 21 | +class MemoryPool(_Weakrefable): |
| 22 | + def release_unused(self) -> None: ... |
| 23 | + |
| 24 | + def bytes_allocated(self) -> int: ... |
| 25 | + |
| 26 | + def total_bytes_allocated(self) -> int: ... |
| 27 | + |
| 28 | + def max_memory(self) -> int | None: ... |
| 29 | + |
| 30 | + def num_allocations(self) -> int: ... |
| 31 | + |
| 32 | + def print_stats(self) -> None: ... |
| 33 | + |
| 34 | + @property |
| 35 | + def backend_name(self) -> str: ... |
| 36 | + |
| 37 | + |
| 38 | +class LoggingMemoryPool(MemoryPool): |
| 39 | + ... |
| 40 | + |
| 41 | + |
| 42 | +class ProxyMemoryPool(MemoryPool): |
| 43 | + ... |
| 44 | + |
| 45 | + |
| 46 | +def default_memory_pool() -> MemoryPool: ... |
| 47 | + |
| 48 | + |
| 49 | +def proxy_memory_pool(parent: MemoryPool) -> ProxyMemoryPool: ... |
| 50 | + |
| 51 | + |
| 52 | +def logging_memory_pool(parent: MemoryPool) -> LoggingMemoryPool: ... |
| 53 | + |
| 54 | + |
| 55 | +def system_memory_pool() -> MemoryPool: ... |
| 56 | + |
| 57 | + |
| 58 | +def jemalloc_memory_pool() -> MemoryPool: ... |
| 59 | + |
| 60 | + |
| 61 | +def mimalloc_memory_pool() -> MemoryPool: ... |
| 62 | + |
| 63 | + |
| 64 | +def set_memory_pool(pool: MemoryPool) -> None: ... |
| 65 | + |
| 66 | + |
| 67 | +def log_memory_allocations(enable: bool = True) -> None: ... |
| 68 | + |
| 69 | + |
| 70 | +def total_allocated_bytes() -> int: ... |
| 71 | + |
| 72 | + |
| 73 | +def jemalloc_set_decay_ms(decay_ms: int) -> None: ... |
| 74 | + |
| 75 | + |
| 76 | +def supported_memory_backends() -> list[str]: ... |
| 77 | + |
| 78 | + |
| 79 | +__all__ = [ |
| 80 | + "MemoryPool", |
| 81 | + "LoggingMemoryPool", |
| 82 | + "ProxyMemoryPool", |
| 83 | + "default_memory_pool", |
| 84 | + "proxy_memory_pool", |
| 85 | + "logging_memory_pool", |
| 86 | + "system_memory_pool", |
| 87 | + "jemalloc_memory_pool", |
| 88 | + "mimalloc_memory_pool", |
| 89 | + "set_memory_pool", |
| 90 | + "log_memory_allocations", |
| 91 | + "total_allocated_bytes", |
| 92 | + "jemalloc_set_decay_ms", |
| 93 | + "supported_memory_backends", |
| 94 | +] |
0 commit comments