- Timestamp:
- 11/27/14 10:44:48 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 2c3c657
- Parents:
- 3b4ca3a
- git-author:
- Sebastian Huber <sebastian.huber@…> (11/27/14 10:44:48)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (11/28/14 10:23:53)
- Location:
- doc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/shell/memory.t
r3b4ca3a r01557b0 531 531 532 532 @example 533 malloc [ info|stats]533 malloc [walk] 534 534 @end example 535 535 536 536 @subheading DESCRIPTION: 537 537 538 This command prints either information or statistics about the 539 C Program Heap used by the @code{malloc} family of calls based upon 540 the value of the first argument passed to the command. 541 542 When the subcommand @code{info} is specified, information on the 543 current state of the C Program Heap is reported. This includes the following 544 information: 538 This command prints information about the current state of the C Program Heap 539 used by the @code{malloc()} family of calls if no or invalid options are passed 540 to the command. This includes the following information: 545 541 546 542 @itemize @bullet … … 553 549 @end itemize 554 550 555 When the subcommand @code{stats} is specified, statistics on the 556 the C Program Heap are reported. Malloc Family Statistics must 557 be enabled for all of the values to be updated. The statistics 558 available includes the following information: 559 560 @itemize @bullet 561 @item 562 @item Currently available memory (in kilobytes) 563 @item Currently allocated memory (in kilobytes) 564 @item Maximum amount of memory ever allocated (in kilobytes) 565 @item Lifetime tally of allocated memory (in kilobytes) 566 @item Lifetime tally of freed memory (in kilobytes) 567 @item Number of calls to @code{malloc} 568 @item Number of calls to @code{free} 569 @item Number of calls to @code{realloc} 570 @item Number of calls to @code{calloc} 571 @end itemize 551 When the subcommand @code{walk} is specified, then a heap walk will be 552 performed and information about each block is printed out. 572 553 573 554 @subheading EXIT STATUS: … … 577 558 @subheading NOTES: 578 559 579 @findex CONFIGURE_MALLOC_STATISTICS 580 581 The @code{CONFIGURE_MALLOC_STATISTICS} @code{confdefs.h} constant 582 must be defined when the application is configured for the full 583 set of statistics information to be available. 560 NONE 584 561 585 562 @subheading EXAMPLES: … … 588 565 589 566 @example 590 SHLL [/] $ malloc info567 SHLL [/] $ malloc 591 568 Number of free blocks: 3 592 569 Largest free block: 3626672 … … 595 572 Largest used block: 1048 596 573 Total bytes used: 10136 597 SHLL [/] $ malloc stats 598 Malloc statistics 599 avail:3552k allocated:9k (0%) max:10k (0%) lifetime:21k freed:12k 600 Call counts: malloc:203 free:93 realloc:0 calloc:20 601 SHLL [/] $ malloc info 602 Number of free blocks: 3 603 Largest free block: 3626672 604 Total bytes free: 3627768 605 Number of used blocks: 130 606 Largest used block: 1048 607 Total bytes used: 10136 608 SHLL [/] $ malloc stats 609 Malloc statistics 610 avail:3552k allocated:9k (0%) max:10k (0%) lifetime:23k freed:14k 611 Call counts: malloc:205 free:95 realloc:0 calloc:20 612 @end example 613 614 Note that in the above example, the lifetime allocated and free 615 values have increased between the two calls to @code{malloc stats} 616 even though the amount of memory available in the C Program Heap 617 is the same in both the @code{malloc info} invocations. This indicates 618 that memory was allocated and freed as a side-effect of the commands. 574 SHLL [/] $ malloc walk 575 malloc walk 576 PASS[0]: page size 8, min block size 48 577 area begin 0x00210210, area end 0x0FFFC000 578 first block 0x00210214, last block 0x0FFFBFDC 579 first free 0x00228084, last free 0x00228354 580 PASS[0]: block 0x00210214: size 88 581 ... 582 PASS[0]: block 0x00220154: size 144 583 PASS[0]: block 0x002201E4: size 168, prev 0x002205BC, next 0x00228354 (= last free) 584 PASS[0]: block 0x0022028C: size 168, prev_size 168 585 ... 586 PASS[0]: block 0x00226E7C: size 4136 587 PASS[0]: block 0x00227EA4: size 408, prev 0x00228084 (= first free), next 0x00226CE4 588 PASS[0]: block 0x0022803C: size 72, prev_size 408 589 PASS[0]: block 0x00228084: size 648, prev 0x0020F75C (= head), next 0x00227EA4 590 PASS[0]: block 0x0022830C: size 72, prev_size 648 591 PASS[0]: block 0x00228354: size 266157192, prev 0x002201E4, next 0x0020F75C (= tail) 592 PASS[0]: block 0x0FFFBFDC: size 4028711480, prev_size 266157192 593 @end example 619 594 620 595 @subheading CONFIGURATION: -
doc/user/conf.t
r3b4ca3a r01557b0 2433 2433 related configuration parameters supported by 2434 2434 @code{<rtems/confdefs.h>}. 2435 2436 @c2437 @c === CONFIGURE_MALLOC_STATISTICS ===2438 @c2439 @subsection Enable Malloc Family Statistics2440 2441 @findex CONFIGURE_MALLOC_STATISTICS2442 2443 2444 @table @b2445 @item CONSTANT:2446 @code{CONFIGURE_MALLOC_STATISTICS}2447 2448 @item DATA TYPE:2449 Boolean feature macro.2450 2451 @item RANGE:2452 Defined or undefined.2453 2454 @item DEFAULT VALUE:2455 This is not defined by default, and Malloc Statistics are disabled.2456 2457 @end table2458 2459 @subheading DESCRIPTION:2460 This configuration parameter is defined when the application wishes to2461 enable the gathering of more detailed statistics on the C Malloc Family2462 of routines.2463 2464 @subheading NOTES:2465 None.2466 2435 2467 2436 @c
Note: See TracChangeset
for help on using the changeset viewer.