table of contents
| LTTNG-RECLAIM-MEMO(1) | LTTng Manual | LTTNG-RECLAIM-MEMO(1) |
NAME¶
lttng-reclaim-memory - Reclaim channel memory immediately
SYNOPSIS¶
lttng [GENERAL OPTIONS] reclaim-memory --userspace
[--no-wait] [--older-than=AGEUS]
[--session=SESSION] (--all | CHANNEL...)
DESCRIPTION¶
The lttng reclaim-memory command immediately reclaims memory for the sub-buffers of:
With the --all option
With one or more CHANNEL arguments
The targeted session is either:
With the --session=SESSION argument
Otherwise
See lttng-concepts(7) to learn more about channel memory reclaim.
The channel memory reclaim operation behaviour depends on the configured event record loss mode of the channel:
Discard mode
Overwrite mode
Specify a sub-buffer age threshold with the --older-than=AGEUS option: only sub-buffers of which the age of the closing time is older than AGEUS µs are eligible for a memory reclaim. Moreover:
If AGEUS > last stream activity age
If AGEUS < last stream activity age
The LTTng tracers flush for the targeted channel so that any open sub-buffer gets closed to become eligible.
By default, the command waits for the memory reclaim operation to complete and displays the number of reclaimed sub-buffers. Use the --no-wait option to exit immediately without waiting for completion.
See the “EXAMPLES” section below for usage examples.
OPTIONS¶
See lttng(1) for GENERAL OPTIONS.
Program information¶
-h, --help
This option attempts to launch /usr/bin/man to view this manual page. Override the manual pager path with the LTTNG_MAN_BIN_PATH environment variable.
--list-options
-a, --all
--older-than=AGEUS
The ms (milliseconds), s (seconds), m (minutes), and h (hours) suffixes are supported.
--no-wait
-s SESSION, --session=SESSION
-u, --userspace
As of LTTng 2.15.0, this option is mandatory.
EXIT STATUS¶
0
1
2
3
4
ENVIRONMENT¶
LTTNG_ABORT_ON_ERROR
LTTNG_HOME
Defaults to $HOME.
Useful when the Unix user running the commands has a non-writable home directory.
LTTNG_LIST_LEGACY
Note that the legacy output doesn’t show anything related to features introduced after LTTng 2.14.
LTTNG_MAN_BIN_PATH
LTTNG_NO_UTF_8
LTTNG_SESSION_CONFIG_XSD_PATH
LTTNG_SESSIOND_PATH
The --sessiond-path general option overrides this environment variable.
LTTNG_TERM_COLOR
The NO_COLOR environment variable overrides this.
One of:
auto (default)
always
never
NO_COLOR
See NO_COLOR <https://no-color.org/> to learn more.
FILES¶
$LTTNG_HOME/.lttngrc
This is where LTTng stores the name of the Unix user’s current recording session between executions of lttng(1). lttng-create(1) and lttng-set-session(1) set the current recording session.
$LTTNG_HOME/lttng-traces
Override this path with the --output option of the lttng-create(1) command.
$LTTNG_HOME/.lttng
$LTTNG_HOME/.lttng/sessions
/etc/lttng/sessions
Note
$LTTNG_HOME defaults to the value of the HOME environment variable.
EXAMPLES¶
Example 1. Reclaim memory for all eligible sub-buffers of user space channel my-channel (current recording session).
$ lttng reclaim-memory --userspace my-channel
Example 2. Reclaim memory for sub-buffers older than 2 s of user space channels mon-canal and mein-Kanal (current recording session).
$ lttng reclaim-memory --userspace --older-than=2s \
mon-canal mein-Kanal
Example 3. Reclaim memory for all user space channels of the recording session named my-session without waiting for completion.
$ lttng reclaim-memory --userspace --session=my-session \
--no-wait --all
RESOURCES¶
COPYRIGHT¶
This program is part of the LTTng-tools project.
LTTng-tools is distributed under the GNU General Public License version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>. See the LICENSE <https://github.com/lttng/lttng-tools/blob/master/LICENSE> file for details.
THANKS¶
Special thanks to Michel Dagenais and the DORSAL laboratory <http://www.dorsal.polymtl.ca/> at École Polytechnique de Montréal for the LTTng journey.
Also thanks to the Ericsson teams working on tracing which helped us greatly with detailed bug reports and unusual test cases.
SEE ALSO¶
| 24 September 2025 | LTTng 2.15.0 |