1
$\begingroup$

In ROS1 Noetic, I have the following custom message named Test.msg:

int32 did
string a
string b

And I have another custom message TestList.mgs: Test[] testList

In roscpp, when I publish TestList objects on a topic and call rostopic echo /myTopic, the memory starts to have an increasing-decreasing pattern. Without rostopic echo enter image description here

Very important: this memory pattern doesn't occur when Test.msg has only one string typed field:

int32 uid
string a

Any number of string typed fields more than 1 will reproduce the error. Tried adding any other types of members (float32, float64, time, int32, etc), any number of them, the strange memory pattern is not occurring.

Problematic work-around using uint8[]: Found a work-around to the problem by changing string type to uint8[], which resolves the issue, but leads to another issue: ROS1 Noetic Custom messages - Command line publish char[]/uint8[] support

$\endgroup$

1 Answer 1

0
$\begingroup$

Your graph does not show evidence of a memory leak. The minimum repeatedly returns to ~35% level, so not a leak. In a modern computer executing dozens or hundreds of processes, changes in memory/swap level over time are normal.

$\endgroup$
1
  • $\begingroup$ I understand, and I agree that most probably I didn't use the correct term. Although, the memory pattern is concerning: when there is only one string, the graph memory is a flat line (and there are many things running in the code using memory, publishing to the ROS topics, etc.), the only thing that makes this graph go wavy is when I add another string. I will modify the title and use other terms to describe the problem :) Thanks! $\endgroup$
    – Enikő
    Commented Dec 10, 2023 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.