# Copyright (C) 2001-2018, Python Software Foundation # For licence information, see README file. # msgid "" msgstr "" "Project-Id-Version: Python 3.6\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-28 15:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: FRENCH \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../Doc/library/tracemalloc.rst:2 msgid ":mod:`tracemalloc` --- Trace memory allocations" msgstr "" #: ../Doc/library/tracemalloc.rst:9 msgid "**Source code:** :source:`Lib/tracemalloc.py`" msgstr "" #: ../Doc/library/tracemalloc.rst:13 msgid "" "The tracemalloc module is a debug tool to trace memory blocks allocated by " "Python. It provides the following information:" msgstr "" #: ../Doc/library/tracemalloc.rst:16 msgid "Traceback where an object was allocated" msgstr "" #: ../Doc/library/tracemalloc.rst:17 msgid "" "Statistics on allocated memory blocks per filename and per line number: " "total size, number and average size of allocated memory blocks" msgstr "" #: ../Doc/library/tracemalloc.rst:19 msgid "Compute the differences between two snapshots to detect memory leaks" msgstr "" #: ../Doc/library/tracemalloc.rst:21 msgid "" "To trace most memory blocks allocated by Python, the module should be " "started as early as possible by setting the :envvar:`PYTHONTRACEMALLOC` " "environment variable to ``1``, or by using :option:`-X` ``tracemalloc`` " "command line option. The :func:`tracemalloc.start` function can be called at " "runtime to start tracing Python memory allocations." msgstr "" #: ../Doc/library/tracemalloc.rst:27 msgid "" "By default, a trace of an allocated memory block only stores the most recent " "frame (1 frame). To store 25 frames at startup: set the :envvar:" "`PYTHONTRACEMALLOC` environment variable to ``25``, or use the :option:`-X` " "``tracemalloc=25`` command line option." msgstr "" #: ../Doc/library/tracemalloc.rst:34 msgid "Examples" msgstr "Exemples" #: ../Doc/library/tracemalloc.rst:37 msgid "Display the top 10" msgstr "" #: ../Doc/library/tracemalloc.rst:39 msgid "Display the 10 files allocating the most memory::" msgstr "" #: ../Doc/library/tracemalloc.rst:55 ../Doc/library/tracemalloc.rst:227 msgid "Example of output of the Python test suite::" msgstr "" #: ../Doc/library/tracemalloc.rst:69 msgid "" "We can see that Python loaded ``4855 KiB`` data (bytecode and constants) " "from modules and that the :mod:`collections` module allocated ``244 KiB`` to " "build :class:`~collections.namedtuple` types." msgstr "" #: ../Doc/library/tracemalloc.rst:73 ../Doc/library/tracemalloc.rst:252 msgid "See :meth:`Snapshot.statistics` for more options." msgstr "" #: ../Doc/library/tracemalloc.rst:77 msgid "Compute differences" msgstr "" #: ../Doc/library/tracemalloc.rst:79 msgid "Take two snapshots and display the differences::" msgstr "" #: ../Doc/library/tracemalloc.rst:95 msgid "" "Example of output before/after running some tests of the Python test suite::" msgstr "" #: ../Doc/library/tracemalloc.rst:109 msgid "" "We can see that Python has loaded ``8173 KiB`` of module data (bytecode and " "constants), and that this is ``4428 KiB`` more than had been loaded before " "the tests, when the previous snapshot was taken. Similarly, the :mod:" "`linecache` module has cached ``940 KiB`` of Python source code to format " "tracebacks, all of it since the previous snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:115 msgid "" "If the system has little free memory, snapshots can be written on disk using " "the :meth:`Snapshot.dump` method to analyze the snapshot offline. Then use " "the :meth:`Snapshot.load` method reload the snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:121 msgid "Get the traceback of a memory block" msgstr "" #: ../Doc/library/tracemalloc.rst:123 msgid "Code to display the traceback of the biggest memory block::" msgstr "" #: ../Doc/library/tracemalloc.rst:141 msgid "" "Example of output of the Python test suite (traceback limited to 25 frames)::" msgstr "" #: ../Doc/library/tracemalloc.rst:178 msgid "" "We can see that the most memory was allocated in the :mod:`importlib` module " "to load data (bytecode and constants) from modules: ``870.1 KiB``. The " "traceback is where the :mod:`importlib` loaded data most recently: on the " "``import pdb`` line of the :mod:`doctest` module. The traceback may change " "if a new module is loaded." msgstr "" #: ../Doc/library/tracemalloc.rst:186 msgid "Pretty top" msgstr "" #: ../Doc/library/tracemalloc.rst:188 msgid "" "Code to display the 10 lines allocating the most memory with a pretty " "output, ignoring ```` and ```` files::" msgstr "" #: ../Doc/library/tracemalloc.rst:256 msgid "API" msgstr "" #: ../Doc/library/tracemalloc.rst:259 msgid "Functions" msgstr "Fonctions" #: ../Doc/library/tracemalloc.rst:263 msgid "Clear traces of memory blocks allocated by Python." msgstr "" #: ../Doc/library/tracemalloc.rst:265 msgid "See also :func:`stop`." msgstr "" #: ../Doc/library/tracemalloc.rst:270 msgid "" "Get the traceback where the Python object *obj* was allocated. Return a :" "class:`Traceback` instance, or ``None`` if the :mod:`tracemalloc` module is " "not tracing memory allocations or did not trace the allocation of the object." msgstr "" #: ../Doc/library/tracemalloc.rst:275 msgid "See also :func:`gc.get_referrers` and :func:`sys.getsizeof` functions." msgstr "" #: ../Doc/library/tracemalloc.rst:280 msgid "Get the maximum number of frames stored in the traceback of a trace." msgstr "" #: ../Doc/library/tracemalloc.rst:282 msgid "" "The :mod:`tracemalloc` module must be tracing memory allocations to get the " "limit, otherwise an exception is raised." msgstr "" #: ../Doc/library/tracemalloc.rst:285 msgid "The limit is set by the :func:`start` function." msgstr "" #: ../Doc/library/tracemalloc.rst:290 msgid "" "Get the current size and peak size of memory blocks traced by the :mod:" "`tracemalloc` module as a tuple: ``(current: int, peak: int)``." msgstr "" #: ../Doc/library/tracemalloc.rst:296 msgid "" "Get the memory usage in bytes of the :mod:`tracemalloc` module used to store " "traces of memory blocks. Return an :class:`int`." msgstr "" #: ../Doc/library/tracemalloc.rst:303 msgid "" "``True`` if the :mod:`tracemalloc` module is tracing Python memory " "allocations, ``False`` otherwise." msgstr "" #: ../Doc/library/tracemalloc.rst:306 msgid "See also :func:`start` and :func:`stop` functions." msgstr "" #: ../Doc/library/tracemalloc.rst:311 msgid "" "Start tracing Python memory allocations: install hooks on Python memory " "allocators. Collected tracebacks of traces will be limited to *nframe* " "frames. By default, a trace of a memory block only stores the most recent " "frame: the limit is ``1``. *nframe* must be greater or equal to ``1``." msgstr "" #: ../Doc/library/tracemalloc.rst:316 msgid "" "Storing more than ``1`` frame is only useful to compute statistics grouped " "by ``'traceback'`` or to compute cumulative statistics: see the :meth:" "`Snapshot.compare_to` and :meth:`Snapshot.statistics` methods." msgstr "" #: ../Doc/library/tracemalloc.rst:320 msgid "" "Storing more frames increases the memory and CPU overhead of the :mod:" "`tracemalloc` module. Use the :func:`get_tracemalloc_memory` function to " "measure how much memory is used by the :mod:`tracemalloc` module." msgstr "" #: ../Doc/library/tracemalloc.rst:324 msgid "" "The :envvar:`PYTHONTRACEMALLOC` environment variable " "(``PYTHONTRACEMALLOC=NFRAME``) and the :option:`-X` ``tracemalloc=NFRAME`` " "command line option can be used to start tracing at startup." msgstr "" #: ../Doc/library/tracemalloc.rst:328 msgid "" "See also :func:`stop`, :func:`is_tracing` and :func:`get_traceback_limit` " "functions." msgstr "" #: ../Doc/library/tracemalloc.rst:334 msgid "" "Stop tracing Python memory allocations: uninstall hooks on Python memory " "allocators. Also clears all previously collected traces of memory blocks " "allocated by Python." msgstr "" #: ../Doc/library/tracemalloc.rst:338 msgid "" "Call :func:`take_snapshot` function to take a snapshot of traces before " "clearing them." msgstr "" #: ../Doc/library/tracemalloc.rst:341 msgid "" "See also :func:`start`, :func:`is_tracing` and :func:`clear_traces` " "functions." msgstr "" #: ../Doc/library/tracemalloc.rst:347 msgid "" "Take a snapshot of traces of memory blocks allocated by Python. Return a " "new :class:`Snapshot` instance." msgstr "" #: ../Doc/library/tracemalloc.rst:350 msgid "" "The snapshot does not include memory blocks allocated before the :mod:" "`tracemalloc` module started to trace memory allocations." msgstr "" #: ../Doc/library/tracemalloc.rst:353 msgid "" "Tracebacks of traces are limited to :func:`get_traceback_limit` frames. Use " "the *nframe* parameter of the :func:`start` function to store more frames." msgstr "" #: ../Doc/library/tracemalloc.rst:356 msgid "" "The :mod:`tracemalloc` module must be tracing memory allocations to take a " "snapshot, see the :func:`start` function." msgstr "" #: ../Doc/library/tracemalloc.rst:359 msgid "See also the :func:`get_object_traceback` function." msgstr "" #: ../Doc/library/tracemalloc.rst:363 msgid "DomainFilter" msgstr "" #: ../Doc/library/tracemalloc.rst:367 msgid "Filter traces of memory blocks by their address space (domain)." msgstr "" #: ../Doc/library/tracemalloc.rst:373 msgid "" "If *inclusive* is ``True`` (include), match memory blocks allocated in the " "address space :attr:`domain`." msgstr "" #: ../Doc/library/tracemalloc.rst:376 msgid "" "If *inclusive* is ``False`` (exclude), match memory blocks not allocated in " "the address space :attr:`domain`." msgstr "" #: ../Doc/library/tracemalloc.rst:381 ../Doc/library/tracemalloc.rst:633 msgid "Address space of a memory block (``int``). Read-only property." msgstr "" #: ../Doc/library/tracemalloc.rst:385 msgid "Filter" msgstr "" #: ../Doc/library/tracemalloc.rst:389 msgid "Filter on traces of memory blocks." msgstr "" #: ../Doc/library/tracemalloc.rst:391 msgid "" "See the :func:`fnmatch.fnmatch` function for the syntax of " "*filename_pattern*. The ``'.pyc'`` file extension is replaced with ``'.py'``." msgstr "" #: ../Doc/library/tracemalloc.rst:395 msgid "Examples:" msgstr "Exemples : ::" #: ../Doc/library/tracemalloc.rst:397 msgid "" "``Filter(True, subprocess.__file__)`` only includes traces of the :mod:" "`subprocess` module" msgstr "" #: ../Doc/library/tracemalloc.rst:399 msgid "" "``Filter(False, tracemalloc.__file__)`` excludes traces of the :mod:" "`tracemalloc` module" msgstr "" #: ../Doc/library/tracemalloc.rst:401 msgid "``Filter(False, \"\")`` excludes empty tracebacks" msgstr "" #: ../Doc/library/tracemalloc.rst:404 msgid "The ``'.pyo'`` file extension is no longer replaced with ``'.py'``." msgstr "" #: ../Doc/library/tracemalloc.rst:407 ../Doc/library/tracemalloc.rst:628 msgid "Added the :attr:`domain` attribute." msgstr "" #: ../Doc/library/tracemalloc.rst:413 msgid "Address space of a memory block (``int`` or ``None``)." msgstr "" #: ../Doc/library/tracemalloc.rst:415 ../Doc/library/tracemalloc.rst:635 msgid "" "tracemalloc uses the domain ``0`` to trace memory allocations made by " "Python. C extensions can use other domains to trace other resources." msgstr "" #: ../Doc/library/tracemalloc.rst:420 msgid "" "If *inclusive* is ``True`` (include), only match memory blocks allocated in " "a file with a name matching :attr:`filename_pattern` at line number :attr:" "`lineno`." msgstr "" #: ../Doc/library/tracemalloc.rst:424 msgid "" "If *inclusive* is ``False`` (exclude), ignore memory blocks allocated in a " "file with a name matching :attr:`filename_pattern` at line number :attr:" "`lineno`." msgstr "" #: ../Doc/library/tracemalloc.rst:430 msgid "" "Line number (``int``) of the filter. If *lineno* is ``None``, the filter " "matches any line number." msgstr "" #: ../Doc/library/tracemalloc.rst:435 msgid "Filename pattern of the filter (``str``). Read-only property." msgstr "" #: ../Doc/library/tracemalloc.rst:439 msgid "" "If *all_frames* is ``True``, all frames of the traceback are checked. If " "*all_frames* is ``False``, only the most recent frame is checked." msgstr "" #: ../Doc/library/tracemalloc.rst:442 msgid "" "This attribute has no effect if the traceback limit is ``1``. See the :func:" "`get_traceback_limit` function and :attr:`Snapshot.traceback_limit` " "attribute." msgstr "" #: ../Doc/library/tracemalloc.rst:448 msgid "Frame" msgstr "" #: ../Doc/library/tracemalloc.rst:452 msgid "Frame of a traceback." msgstr "" #: ../Doc/library/tracemalloc.rst:454 msgid "The :class:`Traceback` class is a sequence of :class:`Frame` instances." msgstr "" #: ../Doc/library/tracemalloc.rst:458 msgid "Filename (``str``)." msgstr "" #: ../Doc/library/tracemalloc.rst:462 msgid "Line number (``int``)." msgstr "" #: ../Doc/library/tracemalloc.rst:466 msgid "Snapshot" msgstr "" #: ../Doc/library/tracemalloc.rst:470 msgid "Snapshot of traces of memory blocks allocated by Python." msgstr "" #: ../Doc/library/tracemalloc.rst:472 msgid "The :func:`take_snapshot` function creates a snapshot instance." msgstr "" #: ../Doc/library/tracemalloc.rst:476 msgid "" "Compute the differences with an old snapshot. Get statistics as a sorted " "list of :class:`StatisticDiff` instances grouped by *key_type*." msgstr "" #: ../Doc/library/tracemalloc.rst:479 msgid "" "See the :meth:`Snapshot.statistics` method for *key_type* and *cumulative* " "parameters." msgstr "" #: ../Doc/library/tracemalloc.rst:482 msgid "" "The result is sorted from the biggest to the smallest by: absolute value of :" "attr:`StatisticDiff.size_diff`, :attr:`StatisticDiff.size`, absolute value " "of :attr:`StatisticDiff.count_diff`, :attr:`Statistic.count` and then by :" "attr:`StatisticDiff.traceback`." msgstr "" #: ../Doc/library/tracemalloc.rst:490 msgid "Write the snapshot into a file." msgstr "" #: ../Doc/library/tracemalloc.rst:492 msgid "Use :meth:`load` to reload the snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:497 msgid "" "Create a new :class:`Snapshot` instance with a filtered :attr:`traces` " "sequence, *filters* is a list of :class:`DomainFilter` and :class:`Filter` " "instances. If *filters* is an empty list, return a new :class:`Snapshot` " "instance with a copy of the traces." msgstr "" #: ../Doc/library/tracemalloc.rst:502 msgid "" "All inclusive filters are applied at once, a trace is ignored if no " "inclusive filters match it. A trace is ignored if at least one exclusive " "filter matches it." msgstr "" #: ../Doc/library/tracemalloc.rst:506 msgid ":class:`DomainFilter` instances are now also accepted in *filters*." msgstr "" #: ../Doc/library/tracemalloc.rst:512 msgid "Load a snapshot from a file." msgstr "" #: ../Doc/library/tracemalloc.rst:514 msgid "See also :meth:`dump`." msgstr "" #: ../Doc/library/tracemalloc.rst:519 msgid "" "Get statistics as a sorted list of :class:`Statistic` instances grouped by " "*key_type*:" msgstr "" #: ../Doc/library/tracemalloc.rst:523 msgid "key_type" msgstr "" #: ../Doc/library/tracemalloc.rst:523 msgid "description" msgstr "description" #: ../Doc/library/tracemalloc.rst:525 msgid "``'filename'``" msgstr "``'filename'``" #: ../Doc/library/tracemalloc.rst:525 msgid "filename" msgstr "filename" #: ../Doc/library/tracemalloc.rst:526 msgid "``'lineno'``" msgstr "``'lineno'``" #: ../Doc/library/tracemalloc.rst:526 msgid "filename and line number" msgstr "" #: ../Doc/library/tracemalloc.rst:527 msgid "``'traceback'``" msgstr "``'traceback'``" #: ../Doc/library/tracemalloc.rst:527 msgid "traceback" msgstr "traceback" #: ../Doc/library/tracemalloc.rst:530 msgid "" "If *cumulative* is ``True``, cumulate size and count of memory blocks of all " "frames of the traceback of a trace, not only the most recent frame. The " "cumulative mode can only be used with *key_type* equals to ``'filename'`` " "and ``'lineno'``." msgstr "" #: ../Doc/library/tracemalloc.rst:535 msgid "" "The result is sorted from the biggest to the smallest by: :attr:`Statistic." "size`, :attr:`Statistic.count` and then by :attr:`Statistic.traceback`." msgstr "" #: ../Doc/library/tracemalloc.rst:542 msgid "" "Maximum number of frames stored in the traceback of :attr:`traces`: result " "of the :func:`get_traceback_limit` when the snapshot was taken." msgstr "" #: ../Doc/library/tracemalloc.rst:547 msgid "" "Traces of all memory blocks allocated by Python: sequence of :class:`Trace` " "instances." msgstr "" #: ../Doc/library/tracemalloc.rst:550 msgid "" "The sequence has an undefined order. Use the :meth:`Snapshot.statistics` " "method to get a sorted list of statistics." msgstr "" #: ../Doc/library/tracemalloc.rst:555 msgid "Statistic" msgstr "" #: ../Doc/library/tracemalloc.rst:559 msgid "Statistic on memory allocations." msgstr "" #: ../Doc/library/tracemalloc.rst:561 msgid "" ":func:`Snapshot.statistics` returns a list of :class:`Statistic` instances." msgstr "" #: ../Doc/library/tracemalloc.rst:563 msgid "See also the :class:`StatisticDiff` class." msgstr "" #: ../Doc/library/tracemalloc.rst:567 msgid "Number of memory blocks (``int``)." msgstr "" #: ../Doc/library/tracemalloc.rst:571 msgid "Total size of memory blocks in bytes (``int``)." msgstr "" #: ../Doc/library/tracemalloc.rst:575 ../Doc/library/tracemalloc.rst:644 msgid "" "Traceback where the memory block was allocated, :class:`Traceback` instance." msgstr "" #: ../Doc/library/tracemalloc.rst:580 msgid "StatisticDiff" msgstr "" #: ../Doc/library/tracemalloc.rst:584 msgid "" "Statistic difference on memory allocations between an old and a new :class:" "`Snapshot` instance." msgstr "" #: ../Doc/library/tracemalloc.rst:587 msgid "" ":func:`Snapshot.compare_to` returns a list of :class:`StatisticDiff` " "instances. See also the :class:`Statistic` class." msgstr "" #: ../Doc/library/tracemalloc.rst:592 msgid "" "Number of memory blocks in the new snapshot (``int``): ``0`` if the memory " "blocks have been released in the new snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:597 msgid "" "Difference of number of memory blocks between the old and the new snapshots " "(``int``): ``0`` if the memory blocks have been allocated in the new " "snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:603 msgid "" "Total size of memory blocks in bytes in the new snapshot (``int``): ``0`` if " "the memory blocks have been released in the new snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:608 msgid "" "Difference of total size of memory blocks in bytes between the old and the " "new snapshots (``int``): ``0`` if the memory blocks have been allocated in " "the new snapshot." msgstr "" #: ../Doc/library/tracemalloc.rst:614 msgid "" "Traceback where the memory blocks were allocated, :class:`Traceback` " "instance." msgstr "" #: ../Doc/library/tracemalloc.rst:619 msgid "Trace" msgstr "" #: ../Doc/library/tracemalloc.rst:623 msgid "Trace of a memory block." msgstr "" #: ../Doc/library/tracemalloc.rst:625 msgid "" "The :attr:`Snapshot.traces` attribute is a sequence of :class:`Trace` " "instances." msgstr "" #: ../Doc/library/tracemalloc.rst:640 msgid "Size of the memory block in bytes (``int``)." msgstr "" #: ../Doc/library/tracemalloc.rst:649 msgid "Traceback" msgstr "" #: ../Doc/library/tracemalloc.rst:653 msgid "" "Sequence of :class:`Frame` instances sorted from the oldest frame to the " "most recent frame." msgstr "" #: ../Doc/library/tracemalloc.rst:656 msgid "" "A traceback contains at least ``1`` frame. If the ``tracemalloc`` module " "failed to get a frame, the filename ``\"\"`` at line number ``0`` " "is used." msgstr "" #: ../Doc/library/tracemalloc.rst:660 msgid "" "When a snapshot is taken, tracebacks of traces are limited to :func:" "`get_traceback_limit` frames. See the :func:`take_snapshot` function." msgstr "" #: ../Doc/library/tracemalloc.rst:663 msgid "" "The :attr:`Trace.traceback` attribute is an instance of :class:`Traceback` " "instance." msgstr "" #: ../Doc/library/tracemalloc.rst:666 msgid "" "Frames are now sorted from the oldest to the most recent, instead of most " "recent to oldest." msgstr "" #: ../Doc/library/tracemalloc.rst:671 msgid "" "Format the traceback as a list of lines with newlines. Use the :mod:" "`linecache` module to retrieve lines from the source code. If *limit* is " "set, format the *limit* most recent frames if *limit* is positive. " "Otherwise, format the ``abs(limit)`` oldest frames. If *most_recent_first* " "is ``True``, the order of the formatted frames is reversed, returning the " "most recent frame first instead of last." msgstr "" #: ../Doc/library/tracemalloc.rst:678 msgid "" "Similar to the :func:`traceback.format_tb` function, except that :meth:`." "format` does not include newlines." msgstr "" #: ../Doc/library/tracemalloc.rst:681 msgid "Example::" msgstr "Exemple ::" #: ../Doc/library/tracemalloc.rst:687 msgid "Output::" msgstr "Sortie ::"