'\" t .\" Title: lttng-reclaim-memory .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 20 March 2026 .\" Manual: LTTng Manual .\" Source: LTTng 2.16.0 .\" Language: English .\" .TH "LTTNG\-RECLAIM\-MEMO" "1" "20 March 2026" "LTTng 2\&.16\&.0" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" lttng-reclaim-memory \- Reclaim event record channel memory immediately .SH "SYNOPSIS" .sp .nf \fBlttng\fR [\fIGENERAL OPTIONS\fR] \fBreclaim\-memory\fR \fB--userspace\fR [\fB--no-wait\fR] [\fB--older-than\fR=\fIAGEUS\fR] [\fB--session\fR=\fISESSION\fR] (\fB--all\fR | \fICHANNEL\fR\&...) .fi .SH "DESCRIPTION" .sp The \fBlttng reclaim-memory\fR command immediately reclaims memory for the sub\-buffers of: .PP With the \fB--all\fR option .RS 4 All the user space event record channels of the targeted session\&. .RE .PP With one or more \fICHANNEL\fR arguments .RS 4 Each named user space event record channel\&. .RE .sp The targeted session is either: .PP With the \fB--session\fR=\fISESSION\fR argument .RS 4 The recording session named \fISESSION\fR\&. .RE .PP Otherwise .RS 4 The current recording session (see \fBlttng-concepts\fR(7) to learn more about the current recording session)\&. .RE .sp See \fBlttng-concepts\fR(7) to learn more about event record channel memory reclaim\&. .sp The event record channel memory reclaim operation behaviour depends on the configured event record loss mode of the event record channel: .PP Discard mode .RS 4 Only reclaim sub\-buffers that have been both delivered (completed and ready to be consumed) \fIand\fR consumed, since unconsumed data would be lost forever\&. .RE .PP Overwrite mode .RS 4 Reclaim any delivered sub\-buffer, since old data will be overwritten anyway: no need to wait for consumption\&. .RE .sp Specify a sub\-buffer \fIage threshold\fR with the \fB--older-than\fR=\fIAGEUS\fR option: only sub\-buffers of which the age of the \fIclosing time\fR is older than \fIAGEUS\fR\ \&\(mcs are eligible for a memory reclaim\&. Moreover: .PP If \fIAGEUS\fR\ \&>\ \&last stream activity age .RS 4 The sub\-buffers of which the age, at the moment of closing them, is greater than\ \&\fIAGEUS\fR\ \&\(mcs are eligible for a memory reclaim\&. .RE .PP If \fIAGEUS\fR\ \&<\ \&last stream activity age .RS 4 All the sub\-buffers are eligible\&. .sp The LTTng tracers flush for the targeted event record channel so that any open sub\-buffer gets closed to become eligible\&. .RE .sp By default, the command waits for the memory reclaim operation to complete and displays the number of reclaimed sub\-buffers\&. Use the \fB--no-wait\fR option to exit immediately without waiting for completion\&. .sp See the \(lqEXAMPLES\(rq section below for usage examples\&. .SH "OPTIONS" .sp See \fBlttng\fR(1) for \fIGENERAL OPTIONS\fR\&. .SS "Program information" .PP \fB-h\fR, \fB--help\fR .RS 4 Show help\&. .sp This option attempts to launch \fB/usr/bin/man\fR to view this manual page\&. Override the manual pager path with the \fBLTTNG_MAN_BIN_PATH\fR environment variable\&. .RE .PP \fB--list-options\fR .RS 4 List available command options and quit\&. .RE .PP \fB-a\fR, \fB--all\fR .RS 4 Reclaim memory for all the user space event record channels of the targeted session\&. .RE .PP \fB--older-than\fR=\fIAGEUS\fR .RS 4 Only reclaim sub\-buffers of which the age (\(mcs) of the closing time is greater than \fIAGEUS\fR\ \&\(mcs instead of reclaiming the memory of all eligible sub\-buffers\&. .sp The \fBms\fR\ \&(milliseconds), \fBs\fR\ \&(seconds), \fBm\fR\ \&(minutes), and \fBh\fR\ \&(hours) suffixes are supported\&. .RE .PP \fB--no-wait\fR .RS 4 Do NOT wait for the memory reclaim operation to complete before exiting\&. .RE .PP \fB-s\fR \fISESSION\fR, \fB--session\fR=\fISESSION\fR .RS 4 Reclaim memory for event record channels of the recording session named \fISESSION\fR\&. .RE .PP \fB-u\fR, \fB--userspace\fR .RS 4 Reclaim memory of a user space event record channel\&. .sp As of LTTng\ \&2\&.16\&.0, this option is mandatory\&. .RE .SH "EXIT STATUS" .PP \fB0\fR .RS 4 Success .RE .PP \fB1\fR .RS 4 Command error .RE .PP \fB2\fR .RS 4 Undefined command .RE .PP \fB3\fR .RS 4 Fatal error .RE .PP \fB4\fR .RS 4 Command warning (something went wrong during the command) .RE .SH "ENVIRONMENT" .PP \fBLTTNG_ABORT_ON_ERROR\fR .RS 4 Set to \fB1\fR to abort the process after the first error is encountered\&. .RE .PP \fBLTTNG_HOME\fR .RS 4 Path to the LTTng home directory\&. .sp Defaults to \fB$HOME\fR\&. .sp Useful when the Unix user running the commands has a non\-writable home directory\&. .RE .PP \fBLTTNG_LIST_LEGACY\fR .RS 4 Set to \fB1\fR to use the legacy output format (LTTng\ \&2\&.14 and earlier) for the \fBlttng-list\fR(1) command instead of the modern output format\&. .sp Note that the legacy output doesn\(cqt show anything related to features introduced after LTTng\ \&2\&.14\&. .RE .PP \fBLTTNG_MAN_BIN_PATH\fR .RS 4 Absolute path to the manual pager to use to read the LTTng command\-line help (with \fBlttng-help\fR(1) or with the \fB--help\fR option) instead of \fB/usr/bin/man\fR\&. .RE .PP \fBLTTNG_NO_UTF_8\fR .RS 4 Set to \fB1\fR to NOT emit multi\-byte UTF\-8 sequences, even if the locale claims to support it\&. .RE .PP \fBLTTNG_SESSION_CONFIG_XSD_PATH\fR .RS 4 Path to the directory containing the \fBsession.xsd\fR recording session configuration XML schema\&. .RE .PP \fBLTTNG_SESSIOND_PATH\fR .RS 4 Absolute path to the LTTng session daemon binary (see \fBlttng-sessiond\fR(8)) to spawn from the \fBlttng-create\fR(1) command\&. .sp The \fB--sessiond-path\fR general option overrides this environment variable\&. .RE .PP \fBLTTNG_TERM_COLOR\fR .RS 4 Controls when to emit terminal SGR codes in the output\&. .sp The \fBNO_COLOR\fR environment variable overrides this\&. .sp One of: .PP \fBauto\fR (default) .RS 4 Only emit SGR codes when the standard output is connected to a color\-capable terminal\&. .RE .PP \fBalways\fR .RS 4 Always emit SGR codes\&. .RE .PP \fBnever\fR .RS 4 Never emit SGR codes\&. .RE .RE .PP \fBNO_COLOR\fR .RS 4 If set and not empty, then it\(cqs equivalent to setting \fBLTTNG_TERM_COLOR\fR to \fBnever\fR\&. .sp See NO_COLOR to learn more\&. .RE .SH "FILES" .PP \fB$LTTNG_HOME/.lttngrc\fR .RS 4 Unix user\(cqs LTTng runtime configuration\&. .sp This is where LTTng stores the name of the Unix user\(cqs current recording session between executions of \fBlttng\fR(1)\&. \fBlttng-create\fR(1) and \fBlttng-set-session\fR(1) set the current recording session\&. .RE .PP \fB$LTTNG_HOME/lttng-traces\fR .RS 4 Default output directory of LTTng traces in local and snapshot modes\&. .sp Override this path with the \fB--output\fR option of the \fBlttng-create\fR(1) command\&. .RE .PP \fB$LTTNG_HOME/.lttng\fR .RS 4 Unix user\(cqs LTTng runtime and configuration directory\&. .RE .PP \fB$LTTNG_HOME/.lttng/sessions\fR .RS 4 Default directory containing the Unix user\(cqs saved recording session configurations (see \fBlttng-save\fR(1) and \fBlttng-load\fR(1))\&. .RE .PP \fB/usr/local/etc/lttng/sessions\fR .RS 4 Directory containing the system\-wide saved recording session configurations (see \fBlttng-save\fR(1) and \fBlttng-load\fR(1))\&. .RE .if n \{\ .sp .\} .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .RS 4 .sp \fB$LTTNG_HOME\fR defaults to the value of the \fBHOME\fR environment variable\&. .sp .5v .RE .SH "EXAMPLES" .PP \fBExample\ \&1.\ \&Reclaim memory for all eligible sub\-buffers of user space event record channel \fBmy-channel\fR (current recording session)\&.\fR .RS 4 .sp .if n \{\ .RS 4 .\} .nf $ lttng reclaim\-memory \-\-userspace my\-channel .fi .if n \{\ .RE .\} .RE .PP \fBExample\ \&2.\ \&Reclaim memory for sub\-buffers older than 2\ \&s of user space event record channels \fBmon-canal\fR and \fBmein-Kanal\fR (current recording session)\&.\fR .RS 4 .sp .if n \{\ .RS 4 .\} .nf $ lttng reclaim\-memory \-\-userspace \-\-older\-than=2s \e mon\-canal mein\-Kanal .fi .if n \{\ .RE .\} .RE .PP \fBExample\ \&3.\ \&Reclaim memory for all user space event record channels of the recording session named \fBmy-session\fR without waiting for completion\&.\fR .RS 4 .sp .if n \{\ .RS 4 .\} .nf $ lttng reclaim\-memory \-\-userspace \-\-session=my\-session \e \-\-no\-wait \-\-all .fi .if n \{\ .RE .\} .RE .SH "RESOURCES" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng project website .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng documentation .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng bug tracker .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Git repositories .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} GitHub organization .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Continuous integration .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Mailing list for support and development: \fBlttng-dev@lists.lttng.org\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} IRC channel : \fB#lttng\fR on \fBirc.oftc.net\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Mastodon .RE .SH "COPYRIGHT" .sp This program is part of the LTTng\-tools project\&. .sp LTTng\-tools is distributed under the GNU General Public License version\ \&2 \&. See the \fBLICENSE\fR file for details\&. .SH "THANKS" .sp Special thanks to Michel Dagenais and the DORSAL laboratory at \('Ecole Polytechnique de Montr\('eal for the LTTng journey\&. .sp Also thanks to the Ericsson teams working on tracing which helped us greatly with detailed bug reports and unusual test cases\&. .SH "SEE ALSO" .sp \fBlttng\fR(1), \fBlttng-concepts\fR(7), \fBlttng-enable-channel\fR(1)