Fast-DDS icon indicating copy to clipboard operation
Fast-DDS copied to clipboard

`TopicPayloadPool` memory leak problem

Open fujitatomoya opened this issue 1 year ago • 4 comments
trafficstars

Is there an already existing issue for this?

  • [X] I have searched the existing issues

Expected behavior

TopicPayloadPool::all_payloads_ should not memory leak, instead it should be able to release the heap memory accordingly.

Current behavior

TopicPayloadPool::all_payloads_ memory usage rises, and never be reduced.

Steps to reproduce

  1. Enable Security with -DSECURITY=ON.
  2. based on SecureHelloWorldExample, create 2 subscriptions with different partition like below.

image

  1. create one publisher that switches partition to subscriber A and B after matching.
  2. on each matching, memory leak happens on publisher and subscriptions.

Fast DDS version/commit

Originally found on v2.10.1.

Platform/Architecture

Ubuntu Focal 20.04 arm64

Transport layer

UDPv4

Additional context

image

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

fujitatomoya avatar Mar 13 '24 04:03 fujitatomoya

@MiguelCompany @EduPonz this looks like a memory leak bug pretty much... do you happen to know the existed issue?

fujitatomoya avatar Mar 13 '24 04:03 fujitatomoya

CC: @Barry-Xu-2018

fujitatomoya avatar Mar 13 '24 04:03 fujitatomoya

Hi @fujitatomoya, thanks for the report. We will address it in the next few days. Do you know if it also happens with security disabled? Regarding changing partitions, have you tried without changing partitions? It would be lovely if you can also provide a minimal reproducer. Thanks again!

JesusPoderoso avatar Mar 14 '24 09:03 JesusPoderoso

Do you know if it also happens with security disabled?

No this problem does not happen without security.

Regarding changing partitions, have you tried without changing partitions?

This problem (increasing memory usage) happens only when switching the partition.

fujitatomoya avatar Mar 14 '24 16:03 fujitatomoya

@fujitatomoya Could you provide details on the configuration?

We would need the QoS configuration of the publisher and the subscribers, and also the security configuration (the protection kinds in particular)

MiguelCompany avatar Mar 15 '24 09:03 MiguelCompany

@fujitatomoya We finally found the issue. See https://github.com/eProsima/Fast-DDS/pull/4673 for a fix

MiguelCompany avatar Apr 09 '24 14:04 MiguelCompany

@MiguelCompany thanks! appreciate that!

fujitatomoya avatar Apr 15 '24 21:04 fujitatomoya