Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak with sequence in IDL struct if DataReader::take_next_sample() is called from a different thread #4462

Open
1 task done
githubposter12 opened this issue Feb 28, 2024 · 1 comment
Labels
need more info Issue that requires more info from contributor

Comments

@githubposter12
Copy link

githubposter12 commented Feb 28, 2024

HelloWorldExample.zip

Is there an already existing issue for this?

  • I have searched the existing issues

I'm aware of the ticket #4317 but I wasn't sure if my issue is exactly the same,
since it mentions SHM transport.

Expected behavior

no memory leak

Current behavior

memory usage keeps growing

Steps to reproduce

  1. Create a message with sequence data type in IDL file, eg:
struct Message
{
    sequence<char>  data;
};
  1. use UDPv4 transport
  2. send 32k bytes in the sequence field of the message struct
  3. call datareader->take_next_sample() from a different thread instead of calling it in DataReaderListener::on_data_available()
  4. memory usage continues to grow
  5. move take_next_sample() into the DataReaderListener::on_data_available() callback and the memory leak goes away

I've attached a modified version of the HelloWorldExample showing the error.

Fast DDS version/commit

tested with FastDDS 2.13.2 and 2.9.1 windows 32-bit official installers. both produced the error.

Platform/Architecture

Windows 10 Visual Studio 2019

Transport layer

UDPv4, SHM

Additional context

No response

XML configuration file

<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">

    <transport_descriptors>
        <transport_descriptor>
            <transport_id>udp_transport</transport_id>
            <type>UDPv4</type>
        </transport_descriptor>
    </transport_descriptors>

    <participant profile_name="testclient">
        <domainId>0</domainId>
        <rtps>
            <name>testclient</name>
            <userTransports>
                <transport_id>udp_transport</transport_id>
            </userTransports>
            <useBuiltinTransports>false</useBuiltinTransports>
        </rtps>
    </participant>

    <participant profile_name="testserver">
        <domainId>0</domainId>
        <rtps>
            <name>testserver</name>
            <userTransports>
                <transport_id>udp_transport</transport_id>
            </userTransports>
            <useBuiltinTransports>false</useBuiltinTransports>
        </rtps>
    </participant>

</profiles>

Relevant log output

No response

Network traffic capture

No response

@githubposter12 githubposter12 added the triage Issue pending classification label Feb 28, 2024
@githubposter12 githubposter12 changed the title FastDDS leaks memory with sequence in IDL struct if DataReader::take_next_sample() is called from a different thread memory leak with sequence in IDL struct if DataReader::take_next_sample() is called from a different thread Feb 28, 2024
@cferreiragonz
Copy link
Contributor

Hi @githubposter12,

Apologies for the delayed response. Could you please check if this issue persists in the more recent versions, such as 2.14 or 3.x?

Thank you!

@cferreiragonz cferreiragonz added need more info Issue that requires more info from contributor and removed triage Issue pending classification labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Issue that requires more info from contributor
Projects
None yet
Development

No branches or pull requests

2 participants