/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
pyarrow
/
/usr/local/lib64/python3.6/site-packages/pyarrow
mkdir
upload
Name
Size
Mode
Actions
include/
-
0755
rm
includes/
-
0755
rm
tensorflow/
-
0755
rm
tests/
-
0755
rm
vendored/
-
0755
rm
__pycache__/
-
0755
rm
array.pxi
79609
0644
edit
dl
rm
benchmark.pxi
869
0644
edit
dl
rm
benchmark.py
856
0644
edit
dl
rm
builder.pxi
2688
0644
edit
dl
rm
cffi.py
2178
0644
edit
dl
rm
compat.pxi
1810
0644
edit
dl
rm
compat.py
1076
0644
edit
dl
rm
compute.py
22837
0644
edit
dl
rm
config.pxi
2613
0644
edit
dl
rm
csv.py
962
0644
edit
dl
rm
cuda.py
1087
0644
edit
dl
rm
dataset.py
33333
0644
edit
dl
rm
error.pxi
7807
0644
edit
dl
rm
feather.py
9258
0644
edit
dl
rm
filesystem.py
14468
0644
edit
dl
rm
flight.py
1794
0644
edit
dl
rm
fs.py
13444
0644
edit
dl
rm
gandiva.pyx
18447
0644
edit
dl
rm
hdfs.py
7527
0644
edit
dl
rm
io.pxi
64495
0644
edit
dl
rm
ipc.pxi
28821
0644
edit
dl
rm
ipc.py
8029
0644
edit
dl
rm
json.py
858
0644
edit
dl
rm
jvm.py
9593
0644
edit
dl
rm
lib.cpython-36m-x86_64-linux-gnu.so
3760528
0755
edit
dl
rm
lib.pxd
14442
0644
edit
dl
rm
lib.pyx
4373
0644
edit
dl
rm
libarrow.so.600
48162600
0755
edit
dl
rm
libarrow_dataset.so.600
2541120
0755
edit
dl
rm
libarrow_flight.so.600
12999784
0755
edit
dl
rm
libarrow_python.so.600
1848920
0755
edit
dl
rm
libarrow_python_flight.so.600
112728
0755
edit
dl
rm
libparquet.so.600
4458552
0755
edit
dl
rm
libplasma.so.600
251296
0755
edit
dl
rm
lib_api.h
19153
0644
edit
dl
rm
memory.pxi
7451
0644
edit
dl
rm
orc.py
5269
0644
edit
dl
rm
pandas-shim.pxi
7987
0644
edit
dl
rm
pandas_compat.py
42243
0644
edit
dl
rm
parquet.py
86844
0644
edit
dl
rm
plasma-store-server
482776
0755
edit
dl
rm
plasma.py
6075
0644
edit
dl
rm
public-api.pxi
12814
0644
edit
dl
rm
scalar.pxi
29182
0644
edit
dl
rm
serialization.pxi
19086
0644
edit
dl
rm
serialization.py
18202
0644
edit
dl
rm
table.pxi
72277
0644
edit
dl
rm
tensor.pxi
34311
0644
edit
dl
rm
types.pxi
79432
0644
edit
dl
rm
types.py
10381
0644
edit
dl
rm
util.py
5001
0644
edit
dl
rm
_compute.cpython-36m-x86_64-linux-gnu.so
717312
0755
edit
dl
rm
_compute.pxd
1149
0644
edit
dl
rm
_compute.pyx
41759
0644
edit
dl
rm
_csv.cpython-36m-x86_64-linux-gnu.so
312168
0755
edit
dl
rm
_csv.pxd
1602
0644
edit
dl
rm
_csv.pyx
39297
0644
edit
dl
rm
_cuda.pxd
1922
0644
edit
dl
rm
_cuda.pyx
34731
0644
edit
dl
rm
_dataset.cpython-36m-x86_64-linux-gnu.so
1080168
0755
edit
dl
rm
_dataset.pxd
1644
0644
edit
dl
rm
_dataset.pyx
120054
0644
edit
dl
rm
_dataset_orc.cpython-36m-x86_64-linux-gnu.so
52536
0755
edit
dl
rm
_dataset_orc.pyx
1345
0644
edit
dl
rm
_feather.cpython-36m-x86_64-linux-gnu.so
94280
0755
edit
dl
rm
_feather.pyx
3623
0644
edit
dl
rm
_flight.cpython-36m-x86_64-linux-gnu.so
1124664
0755
edit
dl
rm
_flight.pyx
93532
0644
edit
dl
rm
_fs.cpython-36m-x86_64-linux-gnu.so
469992
0755
edit
dl
rm
_fs.pxd
2484
0644
edit
dl
rm
_fs.pyx
40017
0644
edit
dl
rm
_generated_version.py
142
0644
edit
dl
rm
_hdfs.cpython-36m-x86_64-linux-gnu.so
127352
0755
edit
dl
rm
_hdfs.pyx
5471
0644
edit
dl
rm
_hdfsio.cpython-36m-x86_64-linux-gnu.so
208096
0755
edit
dl
rm
_hdfsio.pyx
13681
0644
edit
dl
rm
_json.cpython-36m-x86_64-linux-gnu.so
90616
0755
edit
dl
rm
_json.pyx
8406
0644
edit
dl
rm
_orc.cpython-36m-x86_64-linux-gnu.so
109776
0755
edit
dl
rm
_orc.pxd
2350
0644
edit
dl
rm
_orc.pyx
5151
0644
edit
dl
rm
_parquet.cpython-36m-x86_64-linux-gnu.so
507792
0755
edit
dl
rm
_parquet.pxd
22084
0644
edit
dl
rm
_parquet.pyx
47997
0644
edit
dl
rm
_plasma.cpython-36m-x86_64-linux-gnu.so
259168
0755
edit
dl
rm
_plasma.pyx
29495
0644
edit
dl
rm
_s3fs.cpython-36m-x86_64-linux-gnu.so
199496
0755
edit
dl
rm
_s3fs.pyx
11662
0644
edit
dl
rm
__init__.pxd
2195
0644
edit
dl
rm
__init__.py
21263
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/pyarrow/memory.pxi
(7451B)
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # cython: profile=False # distutils: language = c++ # cython: embedsignature = True cdef class MemoryPool(_Weakrefable): """ Base class for memory allocation. Besides tracking its number of allocated bytes, a memory pool also takes care of the required 64-byte alignment for Arrow data. """ def __init__(self): raise TypeError("Do not call {}'s constructor directly, " "use pyarrow.*_memory_pool instead." .format(self.__class__.__name__)) cdef void init(self, CMemoryPool* pool): self.pool = pool def release_unused(self): """ Attempt to return to the OS any memory being held onto by the pool. This function should not be called except potentially for benchmarking or debugging as it could be expensive and detrimental to performance. This is best effort and may not have any effect on some memory pools or in some situations (e.g. fragmentation). """ cdef CMemoryPool* pool = c_get_memory_pool() with nogil: pool.ReleaseUnused() def bytes_allocated(self): """ Return the number of bytes that are currently allocated from this memory pool. """ return self.pool.bytes_allocated() def max_memory(self): """ Return the peak memory allocation in this memory pool. This can be an approximate number in multi-threaded applications. None is returned if the pool implementation doesn't know how to compute this number. """ ret = self.pool.max_memory() return ret if ret >= 0 else None @property def backend_name(self): """ The name of the backend used by this MemoryPool (e.g. "jemalloc"). """ return frombytes(self.pool.backend_name()) cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool): if memory_pool is None: return c_get_memory_pool() else: return memory_pool.pool cdef class LoggingMemoryPool(MemoryPool): cdef: unique_ptr[CLoggingMemoryPool] logging_pool def __init__(self): raise TypeError("Do not call {}'s constructor directly, " "use pyarrow.logging_memory_pool instead." .format(self.__class__.__name__)) cdef class ProxyMemoryPool(MemoryPool): """ Memory pool implementation that tracks the number of bytes and maximum memory allocated through its direct calls, while redirecting to another memory pool. """ cdef: unique_ptr[CProxyMemoryPool] proxy_pool def __init__(self): raise TypeError("Do not call {}'s constructor directly, " "use pyarrow.proxy_memory_pool instead." .format(self.__class__.__name__)) def default_memory_pool(): """ Return the process-global memory pool. """ cdef: MemoryPool pool = MemoryPool.__new__(MemoryPool) pool.init(c_get_memory_pool()) return pool def proxy_memory_pool(MemoryPool parent): """ Create and return a MemoryPool instance that redirects to the *parent*, but with separate allocation statistics. Parameters ---------- parent : MemoryPool The real memory pool that should be used for allocations. """ cdef ProxyMemoryPool out = ProxyMemoryPool.__new__(ProxyMemoryPool) out.proxy_pool.reset(new CProxyMemoryPool(parent.pool)) out.init(out.proxy_pool.get()) return out def logging_memory_pool(MemoryPool parent): """ Create and return a MemoryPool instance that redirects to the *parent*, but also dumps allocation logs on stderr. Parameters ---------- parent : MemoryPool The real memory pool that should be used for allocations. """ cdef LoggingMemoryPool out = LoggingMemoryPool.__new__( LoggingMemoryPool, parent) out.logging_pool.reset(new CLoggingMemoryPool(parent.pool)) out.init(out.logging_pool.get()) return out def system_memory_pool(): """ Return a memory pool based on the C malloc heap. """ cdef: MemoryPool pool = MemoryPool.__new__(MemoryPool) pool.init(c_system_memory_pool()) return pool def jemalloc_memory_pool(): """ Return a memory pool based on the jemalloc heap. NotImplementedError is raised if jemalloc support is not enabled. """ cdef: CMemoryPool* c_pool MemoryPool pool = MemoryPool.__new__(MemoryPool) check_status(c_jemalloc_memory_pool(&c_pool)) pool.init(c_pool) return pool def mimalloc_memory_pool(): """ Return a memory pool based on the mimalloc heap. NotImplementedError is raised if mimalloc support is not enabled. """ cdef: CMemoryPool* c_pool MemoryPool pool = MemoryPool.__new__(MemoryPool) check_status(c_mimalloc_memory_pool(&c_pool)) pool.init(c_pool) return pool def set_memory_pool(MemoryPool pool): """ Set the default memory pool. Parameters ---------- pool : MemoryPool The memory pool that should be used by default. """ c_set_default_memory_pool(pool.pool) cdef MemoryPool _default_memory_pool = default_memory_pool() cdef LoggingMemoryPool _logging_memory_pool = logging_memory_pool( _default_memory_pool) def log_memory_allocations(enable=True): """ Enable or disable memory allocator logging for debugging purposes Parameters ---------- enable : bool, default True Pass False to disable logging """ if enable: set_memory_pool(_logging_memory_pool) else: set_memory_pool(_default_memory_pool) def total_allocated_bytes(): """ Return the currently allocated bytes from the default memory pool. Other memory pools may not be accounted for. """ cdef CMemoryPool* pool = c_get_memory_pool() return pool.bytes_allocated() def jemalloc_set_decay_ms(decay_ms): """ Set arenas.dirty_decay_ms and arenas.muzzy_decay_ms to indicated number of milliseconds. A value of 0 (the default) results in dirty / muzzy memory pages being released right away to the OS, while a higher value will result in a time-based decay. See the jemalloc docs for more information It's best to set this at the start of your application. Parameters ---------- decay_ms : int Number of milliseconds to set for jemalloc decay conf parameters. Note that this change will only affect future memory arenas """ check_status(c_jemalloc_set_decay_ms(decay_ms))
Save
cmd:
run