Il 07/09/21 11:21, Mauro S. via Xenomai ha scritto:
Hi all,

consider the simple code attached.

I'm using Xenomai 3.1 on a x86_64 CPU, 2GB RAM.

I compile and link the code using "xeno-config --skin=alchemy --cflags" and "xeno-config --skin=alchemy --ldflags"

* Scenario 1)
   #define printf rt_printf commented out (use printf for prints)

   Changing the NUM_TASKS value, in top command I see these results:

   - NUM_TASKS 2

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S    80068   4%   0% ./test

   - NUM_TASKS 4

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S    80204   4%   0% ./test

   - NUM_TASKS 5

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S    80272   4%   0% ./test

   - NUM_TASKS 6

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S    80340   4%   0% ./test

Virtual memory size increases in a linear way.


* Scenario 2)
   #define printf rt_printf not commented (use rt_printf for prints)

   Changing the NUM_TASKS value, in top command I see these results:

   - NUM_TASKS 2

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S    80068   4%   0% ./test

   - NUM_TASKS 4

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S    80204   4%   0% ./test

   - NUM_TASKS 5

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S     142M   4%   0% ./test

   - NUM_TASKS 6

     PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
     496   480 root     S     206M   4%   0% ./test


Starting from a number of tasks > 4, the VMEM got a jump and then increases very rapidly.

Is it normal? Or I'm misusing the rt_printf?

Thanks in advance, regards

Damn, I forgot the attachment, sorry.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 1229 bytes
Desc: not available
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20210907/0e3c2f5b/attachment.c>

Reply via email to