This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 917971f6927a91e7c3d183ab5773ee9aacbe410d
Author: Marco Casaroli <[email protected]>
AuthorDate: Thu Nov 12 13:01:50 2026 +0100

    Documentation/applications: Add the exitmem test.
    
    exitmem (apps/testing/sched/exitmem) checks that the memory of a process
    comes back when the process ends, also with SMP when the CPUs that ran it
    then idle.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 .../applications/testing/exitmem/index.rst         | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/Documentation/applications/testing/exitmem/index.rst 
b/Documentation/applications/testing/exitmem/index.rst
new file mode 100644
index 00000000000..8baedd6399b
--- /dev/null
+++ b/Documentation/applications/testing/exitmem/index.rst
@@ -0,0 +1,32 @@
+======================================
+``exitmem`` Memory of an ended process
+======================================
+
+This test checks that the memory of a process comes back when the process
+ends.  It needs ``fork()`` (``CONFIG_ARCH_HAVE_FORK``: kernel builds).
+
+``exitmem`` forks children one after the other.  Each child takes a part of
+the free memory with ``malloc()`` (less when its heap is smaller), writes
+every page and ends.  After each ``waitpid()`` the free memory
+(``sysconf(_SC_AVPHYS_PAGES)``) must come back within 3 seconds.
+
+With SMP, each child runs on another CPU than the parent, and a thread of
+the child runs on a third CPU first.  Both CPUs then run only the idle task,
+and must not keep the address environment of the ended child.
+
+Usage::
+
+   exitmem [rounds [percent]]
+
+The defaults are 8 rounds and 40 percent of the free memory.  Example on
+``qemu-armv8a:knsh`` with 4 CPUs:
+
+.. code:: console
+
+   nsh> exitmem
+   exitmem: 4 CPUs, 8 rounds, 40% of the free memory
+   exitmem: round 1 CPU 1: 3600 KiB, free 9052 KiB before, 9032 KiB after
+   exitmem: round 2 CPU 2: 3600 KiB, free 9032 KiB before, 9024 KiB after
+   ...
+   exitmem: round 8 CPU 2: 3600 KiB, free 9016 KiB before, 9016 KiB after
+   exitmem: PASS

Reply via email to