Memory managment with RTT::Logger

Hello,

I am using Orocos RTT and OCL 1.6 under linux.
I am building an Orocos application using the RTT::Logger class to log messages at runtime.

I have noticed that the memory used by my process is constantly increasing (using "top" and "ps axv" under linux).

If I do a simple test component with one line in the updateHook :
log(Info) << "Hello" << endlog();
with a periodic activity of 0.01 second, the size of the process is increasing at around 2 kb/s.

However, it seems that there is no memory leak (according to valgrind).

Is it normal ?
If yes, can I do something to avoid it ? I would exepect the logger class to log into a file "orocos.log" without using unlimited process memory.

Thank you for your help,
Renaud

PS : I can attach the code or make more observations if necessary, tell me ...

Re: Memory managment with RTT::Logger

Renaud Heitz wrote:

Hello,

I am using Orocos RTT and OCL 1.6 under linux.
I am building an Orocos application using the RTT::Logger class to log messages at runtime.

I have noticed that the memory used by my process is constantly increasing (using "top" and "ps axv" under linux).

If I do a simple test component with one line in the updateHook :
log(Info) << "Hello" << endlog();
with a periodic activity of 0.01 second, the size of the process is increasing at around 2 kb/s.

However, it seems that there is no memory leak (according to valgrind).

Is it normal ?
If yes, can I do something to avoid it ? I would exepect the logger class to log into a file "orocos.log" without using unlimited process memory.

There is an internal buffer in the Logger class for in case the remote side requests the log messages. This amount is bounded and the storage is optional. Take a look at the cmake variables

OROSEM_REMOTE_LOGGING
and
ORONUM_LOGGING_BUFSIZE

The BUFSIZE is actually the number of messages stored. In your example, the increase should stop after 10 seconds. If you turn off OROSEM_REMOTE_LOGGING the whole mechanism is removed from your code base.

Peter