]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man1/memusage.1
open.2: Explain ways in which a 'directory file descriptor' can be obtained
[thirdparty/man-pages.git] / man1 / memusage.1
index b615204c46bf24b513861171fe79d8a759c9efde..9cc06838b9de15c3e5b7e7791f009302f5967053 100644 (file)
@@ -21,7 +21,7 @@
 .\" License along with this manual; if not, see
 .\" <http://www.gnu.org/licenses/>.
 .\" %%%LICENSE_END
-.TH MEMUSAGE 1 2013-04-10 "GNU" "Linux user manual"
+.TH MEMUSAGE 1 2019-03-06 "GNU" "Linux user manual"
 .SH NAME
 memusage \- profile memory usage of a program
 .SH SYNOPSIS
@@ -61,7 +61,7 @@ to create a PNG file containing graphical representation
 of the collected data.
 .SS Memory usage summary
 The "Memory usage summary" line output by
-.BR memusage
+.B memusage
 contains three fields:
 .RS 4
 .TP
@@ -105,7 +105,7 @@ The maximum of these differences is then the stack peak.
 .RE
 .PP
 Immediately following this summary line, a table shows the number calls,
-total memory allocated or deallocated, 
+total memory allocated or deallocated,
 and number of failed calls for each intercepted function.
 For
 .BR realloc (3)
@@ -119,8 +119,7 @@ For
 .BR realloc (3),
 the additional field "free" shows reallocations that
 caused a block to be freed (i.e., the reallocated size was 0).
-
-
+.PP
 The "realloc/total memory" of the table output by
 .B memusage
 does not reflect cases where
@@ -145,7 +144,7 @@ Generate PNG graphic and store it in
 Generate binary data file and store it in
 .IR file .
 .TP
-.BI \-u\fR,\ \fB\-\-unbuffered
+.B \-u\fR,\ \fB\-\-unbuffered
 Do not buffer output.
 .TP
 .BI \-b\  size \fR,\ \fB\-\-buffer= size
@@ -153,33 +152,33 @@ Collect
 .I size
 entries before writing them out.
 .TP
-.BI \fB\-\-no-timer
+.B \fB\-\-no-timer
 Disable timer-based
 .RB ( SIGPROF )
 sampling of stack pointer value.
 .TP
-.BI \-m\fR,\ \fB\-\-mmap
+.B \-m\fR,\ \fB\-\-mmap
 Also trace
 .BR mmap (2),
 .BR mremap (2),
 and
-.BR mmap (2).
+.BR munmap (2).
 .TP
-.BI \-?\fR,\ \fB\-\-help
+.B \-?\fR,\ \fB\-\-help
 Print help and exit.
 .TP
-.BI \fB\-\-usage
+.B \-\-usage
 Print a short usage message and exit.
 .TP
-.BI \-V\fR,\ \fB\-\-version
+.B \-V\fR,\ \fB\-\-version
 Print version information and exit.
 .TP
-The following options only apply when generating graphical output:
+The following options apply only when generating graphical output:
 .TP
-.BI \-t\fR,\ \fB\-\-time\-based
+.B \-t\fR,\ \fB\-\-time\-based
 Use time (rather than number of function calls) as the scale for the X axis.
 .TP
-.BI \-T\fR,\ \fB\-\-total
+.B \-T\fR,\ \fB\-\-total
 Also draw a graph of total memory use.
 .TP
 .BI \fB\-\-title= name
@@ -198,17 +197,21 @@ Make the graph
 pixels high.
 .SH EXIT STATUS
 Exit status is equal to the exit status of profiled program.
+.SH BUGS
+To report bugs, see
+.UR http://www.gnu.org/software/libc/bugs.html
+.UE
 .SH EXAMPLE
-Below is a simple program that reallocates a block of 
+Below is a simple program that reallocates a block of
 memory in cycles that rise to a peak before then cyclically
 reallocating the memory in smaller blocks that return to zero.
 After compiling the program and running the following commands,
 a graph of the memory usage of the program can be found in the file
 .IR memusage.png :
-
+.PP
 .in +4n
-.nf
-$ \fBmemusage --data=memusage.dat ./a.out\fP
+.EX
+$ \fBmemusage \-\-data=memusage.dat ./a.out\fP
 \&...
 Memory usage summary: heap total: 45200, heap peak: 6440, stack peak: 224
         total calls  total memory  failed calls
@@ -217,22 +220,22 @@ realloc|        40         44800             0  (nomove:40, dec:19, free:0)
  calloc|         0             0             0
    free|         1           440
 Histogram for block sizes:
-  192-207             1   2% ================
+  192\-207             1   2% ================
 \&...
- 2192-2207            1   2% ================
- 2240-2255            2   4% =================================
- 2832-2847            2   4% =================================
- 3440-3455            2   4% =================================
- 4032-4047            2   4% =================================
- 4640-4655            2   4% =================================
- 5232-5247            2   4% =================================
- 5840-5855            2   4% =================================
- 6432-6447            1   2% ================
+ 2192\-2207            1   2% ================
+ 2240\-2255            2   4% =================================
+ 2832\-2847            2   4% =================================
+ 3440\-3455            2   4% =================================
+ 4032\-4047            2   4% =================================
+ 4640\-4655            2   4% =================================
+ 5232\-5247            2   4% =================================
+ 5840\-5855            2   4% =================================
+ 6432\-6447            1   2% ================
 $ \fBmemusagestat memusage.dat memusage.png\fP
-.fi
+.EE
 .in
 .SS Program source
-.nf
+.EX
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -244,7 +247,7 @@ main(int argc, char *argv[])
      int i, j;
      int *p;
 
-     printf("malloc: %zd\\n", sizeof(int) * 100);
+     printf("malloc: %zd\en", sizeof(int) * 100);
      p = malloc(sizeof(int) * 100);
 
      for (i = 0; i < CYCLES; i++) {
@@ -253,21 +256,17 @@ main(int argc, char *argv[])
          else
              j--;
 
-         printf("realloc: %zd\\n", sizeof(int) * (j * 50 + 110));
+         printf("realloc: %zd\en", sizeof(int) * (j * 50 + 110));
          p = realloc(p, sizeof(int) * (j * 50 + 100));
 
-         printf("realloc: %zd\\n", sizeof(int) * ((j+1) * 150 + 110));
+         printf("realloc: %zd\en", sizeof(int) * ((j+1) * 150 + 110));
          p = realloc(p, sizeof(int) * ((j + 1) * 150 + 110));
      }
 
      free(p);
      exit(EXIT_SUCCESS);
 }
-.fi
-.SH BUGS
-To report bugs, see
-.UR http://www.gnu.org/software/libc/bugs.html
-.UE
+.EE
 .SH SEE ALSO
 .BR memusagestat (1),
 .BR mtrace (1)