per page, with , order by , clip by
Results of 1 - 10 of about 43 for memory (0.006 sec.)
multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ 15055
multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ ソースコード Lib/multiprocessing/shared_memory.py Added in version 3.8. このモジュールは、マルチコアもしくは対称型マルチプロセッサ(SMP) を持つマシン上で実行される、ひ ... とつ以上のプロセスから参照される共有メモリの確保、管理を行うための SharedMemory クラスを提供します。共有メモリのライフサイクル管理、とりわけ複数のプロセスにわたる場合のために、 multiprocessing.managers ... モジュールでは BaseManager のサブクラス SharedMemoryManager も提供されます。 このモジュールでの共有メモリは「POSIX 形式」の共有メモリブロックを指し (実装が必ずしも明示的にそう ... ズ、復元、コピーが必要ですが、メモリを介して直接共有すると性能が大きく向上する場合があります。 class multiprocessing.shared_memory. SharedMemory ( name = None , create = False , size = 0 , * , track = True ) 新しい共有メモリブロックを作成するか、既存の共 ...
https://man.mtool.work/python/3.14/library/multiprocessing.shared_memory.html
メモリ管理 11029
メモリ管理 概要 Python におけるメモリ管理には、全ての Python オブジェクトとデータ構造が入ったプライベートヒープ (private heap) が必須です。プライベートヒープの管理は、内部的には Python メモリマネージャ (Python memory manager) が確実に行いま ... ) といった、様々な動的記憶管理の側面を扱うために、個別のコンポーネントがあります。 最低水準層では、素のメモリ操作関数 (raw memory allocator) がオペレーティングシステムのメモリ管理機構とやりとりして、プライベートヒープ内にPython 関連の全てのデータを記憶 ... そのような例です: PyObject * res ; char * buf = ( char * ) malloc ( BUFSIZ ); /* I/O 用 */ if ( buf == NULL ) return PyErr_NoMemory (); ... buf を使って何らかの I / O 操作を行う ... res = PyBytes_FromString ( buf ); free ( buf ); /* malloc で割り当て済み ... り値として返される bytes オブジェクトを確保する時にだけ必要です。 In most situations, however, it is recommended to allocate memory from the Python heap specifically because the latter is under control of the Python memory manager. For example, this is r ...
https://man.mtool.work/python/3.14/c-api/memory.html
tracemalloc --- メモリ割り当ての追跡 10335
tracemalloc --- メモリ割り当ての追跡 Added in version 3.4. ソースコード: Lib/tracemalloc.py tracemallocモジュールは、Python が割り当てたメモリブロックをトレースするためのデバッグツールです。このモジュールは以下の情報を提供します。 オブジェク ... ication ... snapshot = tracemalloc . take_snapshot () top_stats = snapshot . statistics ( 'traceback' ) # pick the biggest memory block stat = top_stats [ 0 ] print ( " %s memory blocks: %.1f KiB" % ( stat . count , stat . size / 1024 )) for line in st ... ceback . format (): print ( line ) Python テストスイートの出力例です (トレースバックは 25 フレームに制限されています): 903 memory blocks : 870.1 KiB File "<frozen importlib._bootstrap>" , line 716 File "<frozen importlib._bootstrap>" , line 1036 File " ... ような和を 2 回計算します。 数値のリストを作成する非効率な方法で、このリストは一時的に多くのメモリを消費します。 get_traced_memory() と reset_peak() を使うと、和を計算した後の小さなメモリ使用量と、計算中のピーク時のメモリ使用量の両方を確認できます。 imp ...
https://man.mtool.work/python/3.14/library/tracemalloc.html
mmap --- メモリマップファイルのサポート 9733
mmap --- メモリマップファイルのサポート 利用可能な環境 : not WASI. このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、 WebAssembly プラットフォーム を見てください。 Memory-mapped file objects behave like both bytearray a ... n use mmap objects in most places where bytearray are expected; for example, you can use the re module to search through a memory-mapped file. You can also change a single byte by doing obj[index] = 97 , or change a subsequence by assigning to a slice: ... 元のファイルを更新することはありません。 バージョン 3.7 で変更: 定数 ACCESS_DEFAULT が追加されました。 無名メモリ(anonymous memory)にマップするためには fileno として -1 を渡し、length を与えてください。 class mmap. mmap ( fileno , length , tagname = Non ... す。 システムによっては追加のフラグを利用できます。 全一覧は MAP_* 定数 にあります。 prot , if specified, gives the desired memory protection; the two most useful values are PROT_READ and PROT_WRITE , to specify that the pages may be read or written. pr ...
https://man.mtool.work/python/3.14/library/mmap.html
リモートデバッグのアタッチプロトコル 9533
リモートデバッグのアタッチプロトコル このプロトコルを使うと、外部ツールから実行中の CPython プロセスにアタッチし、Python コードをリモートで実行できます。 別の Python プロセスへのアタッチには、プラットフォームによって追加の権限や設定が必要な ... 支援するフィールドなどの内部データにアクセスできます。 To work with a remote Python process, a debugger must first find the memory address of the PyRuntime structure in the target process. This address can't be hardcoded or calculated from a symbol name ... めます。 実装例を示します。 def find_py_runtime_linux ( pid : int ) -> int : # Step 1: Try to find the Python executable in memory binary_path , base_address = find_mapped_binary ( pid , name_contains = "python" ) # Step 2: Fallback to shared library if ... ion offset section_offset = parse_elf_section_offset ( binary_path , ".PyRuntime" ) # Step 4: Compute PyRuntime address in memory return base_address + section_offset Linux では、別のプロセスのメモリを読む主な方法が二つあります。 一つは /proc ファイルシ ...
https://man.mtool.work/python/3.14/howto/remote_debugging.html
sqlite3 --- SQLite データベース用の DB-API 2.0 インターフェース 9533
sqlite3 --- SQLite データベース用の DB-API 2.0 インターフェース ソースコード: Lib/sqlite3/ SQLite は、軽量なディスク上のデータベースを提供する C ライブラリです。別のサーバプロセスを用意する必要なく、 SQL クエリー言語の非標準的な一種を使用し ... ベースとの接続(connection)を開きます。 パラメータ : database ( path-like object ) -- 開くデータベースファイルのパスです。 ":memory:" を渡すと、 メモリ内にのみ存在する SQLite データベース を作成し、接続を開けます。 timeout ( float ) -- テーブルがロックさ ... 例: >>> import hashlib >>> def md5sum ( t ): ... return hashlib . md5 ( t ) . hexdigest () >>> con = sqlite3 . connect ( ":memory:" ) >>> con . create_function ( "md5" , 1 , md5sum ) >>> for row in con . execute ( "SELECT md5(?)" , ( b "foo" ,)): ... p ... 0 def step ( self , value ): self . count += value def finalize ( self ): return self . count con = sqlite3 . connect ( ":memory:" ) con . create_aggregate ( "mysum" , 1 , MySum ) cur = con . execute ( "CREATE TABLE test(i)" ) cur . execute ( "INSERT ...
https://man.mtool.work/python/3.14/library/sqlite3.html
Pythonモジュール索引 8931
Pythonモジュール索引 _ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | z _ __future__ Future statement definitions __main__ The environment where top-level code is run. Covers command-line i ... ints). math Mathematical functions (sin() etc.). mimetypes Mapping of filename extensions to MIME types. mmap Interface to memory-mapped files for Unix and Windows. modulefinder Find modules used by a script. msilib 非推奨: Removed in 3.13. msvcrt Misc ... ers Share data between process with shared objects. multiprocessing.pool Create pools of processes. multiprocessing.shared_memory Provides shared memory for direct access across processes. multiprocessing.sharedctypes Allocate ctypes objects from share ... d memory. n netrc Loading of .netrc files. nis 非推奨: Removed in 3.13. nntplib 非推奨: Removed in 3.13. numbers Numeric abstract b ...
https://man.mtool.work/python/3.14/py-modindex.html
変更履歴 8931
変更履歴 次の Python バージョン リリース日: XXXX-XX-XX セキュリティ gh-160499 : Fix unbounded memory growth in asyncio TLS connections when a peer stops reading but keeps sending records that make OpenSSL generate its own replies (such as T ... build. This fixes a large slowdown in multi-threaded code using functools.wraps() since 3.14.7. gh-151060 : Fix a crash or memory corruption in sum() when summing a float subclass instance into a complex running total. ライブラリ gh-137549 : asyncio.ti ... () accepting TZif data with a negative or oversized abbreviation block, which could use hundreds of times the file size in memory; it now raises ValueError . Abbreviation indexes above 127 now also give the correct time zone abbreviation. gh-161106 : F ... ix plistlib.dump() and plistlib.dumps() with FMT_BINARY holding on to memory proportional to the size of large arrays and dictionaries after the call returns. gh-161098 : Fix multiprocessing.shared_m ...
https://man.mtool.work/python/3.14/whatsnew/changelog.html
モジュールオブジェクト (module object) 8021
モジュールオブジェクト (module object) PyTypeObject PyModule_Type 次に属します: Stable ABI . この PyTypeObject のインスタンスは Python のモジュール型を表します。 Python プログラムには types.ModuleType として公開されています。 int PyModule_C ... tate ( PyObject * module ) 次に属します: Stable ABI . Return the "state" of the module, that is, a pointer to the block of memory allocated at module creation time, or NULL . See PyModuleDef.m_size . PyModuleDef * PyModule_GetDef ( PyObject * module ) ... ate extension modules dynamically . Unlike PyModule_New() , the definition allows management of module state -- a piece of memory that is allocated and cleared together with the module object. Unlike the module's Python attributes, Python code cannot r ... usually a docstring variable created with PyDoc_STRVAR is used. Py_ssize_t m_size Module state may be kept in a per-module memory area that can be retrieved with PyModule_GetState() , rather than in static globals. This makes modules safe for use in mu ...
https://man.mtool.work/python/3.14/c-api/module.html
型オブジェクト 7820
型オブジェクト type PyTypeObject 次に属します: Limited API (不透明な構造体として). 組み込み型を記述する際に用いられる、オブジェクトを表す C 構造体です。 PyTypeObject PyType_Type 次に属します: Stable ABI . 型オブジェクト自身の型オブジェクトで ... nstances of the class need in addition to the superclass. Use PyObject_GetTypeData() to get a pointer to subclass-specific memory reserved this way. For negative basicsize , Python will insert padding when needed to meet tp_basicsize 's alignment requi ... inherited. Extending arbitrary variable-sized classes is dangerous, since some types use a fixed offset for variable-sized memory, which can then overlap fixed-sized memory used by a subclass. To help prevent mistakes, inheriting itemsize is only possi ... USE_SPEC を使うことを推奨します) Py_tp_token 次に属します: Stable ABI (バージョン 3.14 より). A slot that records a static memory layout ID for a class. If the PyType_Spec of the class is statically allocated, the token can be set to the spec using the ...
https://man.mtool.work/python/3.14/c-api/type.html
PREV 1 2 3 4 5 NEXT