Spec-Zone .ru
спецификации, руководства, описания, API
Spec-Zone .ru
спецификации, руководства, описания, API
Библиотека разработчика Mac Разработчик
Поиск

 

Эта страница руководства для  версии 10.9 Mac OS X

Если Вы выполняете различную версию  Mac OS X, просматриваете документацию локально:

Читать страницы руководства

Страницы руководства предназначаются как справочник для людей, уже понимающих технологию.

  • Чтобы изучить, как руководство организовано или узнать о синтаксисе команды, прочитайте страницу руководства для страниц справочника (5).

  • Для получения дополнительной информации об этой технологии, ищите другую документацию в Библиотеке Разработчика Apple.

  • Для получения общей информации о записи сценариев оболочки, считайте Shell, Пишущий сценарий Учебника для начинающих.




heap(1)                   BSD General Commands Manual                  heap(1)

NAME
     heap -- List all the malloc-allocated buffers in the process's heap

SYNOPSIS
     heap [-guessNonObjects] [-sumObjectFields] [-showSizes] [-addresses all | <classes-pattern>]
          [-noContent] pid | partial-executable-name

DESCRIPTION
     heap lists the objects currently allocated on the heap of the specified process, as well as summary
     data.  Objects are categorized by class name, type (Objective-C, C++, or CFType), and binary image.
     C++ objects are identified by the vtable referenced from the start of the object, so with multiple
     inheritance this may not give the precise class of the object.

     The binary image identified for a class is the image which implements the class, not necessarily the
     binary image which caused the objects to be allocated at runtime, or which "owns" those objects.

     heap requires one parameter -- either a process ID or a full or partial executable name.

     The following options are available:

     -guessNonObjects
             Look through the memory contents of each Objective-C object to find pointers to malloc'ed
             blocks (non-objects), such as the variable array hanging from an NSArray.  These referenced
             blocks of memory are identified as their offset from the start of the object (say "__NSCFAr-ray[12]"). "__NSCFArray[12]").
             ray[12]").  The count, number of bytes, and average size of memory blocks referenced from each
             different object offset location are listed in the output.

     -sumObjectFields
             Do the same analysis as with the -guessNonObjects option, but add the sizes of those referenced
             non-object fields into the entries for the corresponding objects.

     -showSizes
             Show the distribution of each malloc size for each object, instead of summing and averaging the
             sizes in a single entry.

     -addresses all | <classes-pattern>
             Print the addresses of all malloc blocks found on the heap in ascending address order, or the
             addresses of those objects whose full class name is matched by the regular expression <classes-
             pattern>.  The string "all" indicates that the addresses of all blocks (both objects and non-objects) nonobjects)
             objects) should be printed.  The <classes-pattern> regular expression is interpreted as an
             extended (modern) regular expression as described by the re_format(7) manual page.  Note that
             toll-freed-bridged CoreFoundation and Foundation classes have the "__NSCF" prefix rather than
             just "NS" or "CF".  Examples of valid classes-patterns include:

                   __NSCFString
                   'NS.*'
                   '__NSCFString|__NSCFArray'
                   '.*(String|Array)'
                   non-object

     -noContent
             Do not show object content in -addresses mode.

SEE ALSO
     malloc(3), leaks(1), malloc_history(1), stringdups(1), vmmap(1), DevToolsSecurity(1)

     The Xcode developer tools also include Instruments, a graphical application that can give information
     similar to that provided by heap. The Allocations instrument graphically displays dynamic, real-time
     information about the object and memory use in an application, including backtraces of where the allo-cations allocations
     cations occurred.  The Leaks instrument performs memory leak analysis.

BSD                              Mar. 16, 2013                             BSD

Сообщение о проблемах

Способ сообщить о проблеме с этой страницей руководства зависит от типа проблемы:

Ошибки содержания
Ошибки отчета в содержании этой документации со ссылками на отзыв ниже.
Отчеты об ошибках
Сообщите об ошибках в функциональности описанного инструмента или API через Генератор отчетов Ошибки.
Форматирование проблем
Отчет, форматирующий ошибки в интерактивной версии этих страниц со ссылками на отзыв ниже.