summaryrefslogtreecommitdiffstats
path: root/upstream/debian-bookworm/man3/malloc_trim.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
commitfc22b3d6507c6745911b9dfcc68f1e665ae13dbc (patch)
treece1e3bce06471410239a6f41282e328770aa404a /upstream/debian-bookworm/man3/malloc_trim.3
parentInitial commit. (diff)
downloadmanpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.tar.xz
manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.zip
Adding upstream version 4.22.0.upstream/4.22.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/debian-bookworm/man3/malloc_trim.3')
-rw-r--r--upstream/debian-bookworm/man3/malloc_trim.384
1 files changed, 84 insertions, 0 deletions
diff --git a/upstream/debian-bookworm/man3/malloc_trim.3 b/upstream/debian-bookworm/man3/malloc_trim.3
new file mode 100644
index 00000000..9433bf1d
--- /dev/null
+++ b/upstream/debian-bookworm/man3/malloc_trim.3
@@ -0,0 +1,84 @@
+'\" t
+.\" Copyright (c) 2012 by Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH malloc_trim 3 2022-12-15 "Linux man-pages 6.03"
+.SH NAME
+malloc_trim \- release free memory from the heap
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " \-lc )
+.SH SYNOPSIS
+.nf
+.B #include <malloc.h>
+.PP
+.BI "int malloc_trim(size_t " pad );
+.fi
+.SH DESCRIPTION
+The
+.BR malloc_trim ()
+function attempts to release free memory from the heap
+(by calling
+.BR sbrk (2)
+or
+.BR madvise (2)
+with suitable arguments).
+.PP
+The
+.I pad
+argument specifies the amount of free space to leave untrimmed
+at the top of the heap.
+If this argument is 0, only the minimum amount of memory is maintained
+at the top of the heap (i.e., one page or less).
+A nonzero argument can be used to maintain some trailing space
+at the top of the heap in order to allow future allocations
+to be made without having to extend the heap with
+.BR sbrk (2).
+.SH RETURN VALUE
+The
+.BR malloc_trim ()
+function returns 1 if memory was actually released back to the system,
+or 0 if it was not possible to release any memory.
+.SH ERRORS
+No errors are defined.
+.\" .SH VERSIONS
+.\" Available already in glibc 2.0, possibly earlier
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.ad l
+.nh
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR malloc_trim ()
+T} Thread safety MT-Safe
+.TE
+.hy
+.ad
+.sp 1
+.SH STANDARDS
+This function is a GNU extension.
+.SH NOTES
+Only the main heap (using
+.BR sbrk (2))
+honors the
+.I pad
+argument; thread heaps do not.
+.PP
+Since glibc 2.8 this function frees memory in all arenas and in all
+chunks with whole free pages.
+.\" See commit 68631c8eb92ff38d9da1ae34f6aa048539b199cc
+.\" (dated 2007-12-16) which adds iteration over all
+.\" arenas and frees all pages in chunks which are free.
+.PP
+Before glibc 2.8 this function only freed memory at the
+top of the heap in the main arena.
+.SH SEE ALSO
+.BR sbrk (2),
+.BR malloc (3),
+.BR mallopt (3)