-
Notifications
You must be signed in to change notification settings - Fork 878
Description
Is there an already existing issue for this?
- I have searched the existing issues
Expected behavior
when create subscription within a loop(as 10000 times), the memory should be stable.
Current behavior
when create subscription within a loop, the memory keeps growing to very large.
Steps to reproduce
class HelloWorldSubscriber
{
~HelloWorldSubscriber()
{
sub->delete_datareader(reader);
participant->delete(topic);
particitpant->unregistger_type(type.get_type_name());
DomainParticipantFactory()::get_instance()->delete_participant(participant);
}
init()
{
participant = DomainParticipantFactory()::get_instance()->create_participant(qos,0);
sub = participant->create_subscriber();
topic = participant->create_topic();
reader = sub->create_datareader();
}
};
int main()
{
HelloWorldSubscriber *ar[40];
int count = 10000;
while(count-->0){
for(int i = 0; i <40;i++)
{
ar = new HelloWorldSubscriber();
if(ar) ar->init();
}
std::this_thread::sleep_for(std::chrono::seconds(1));
for(int i = 0; i < 40; i++)
{
delete ar[i];
ar[i] = nullptr;
}
}
return 0;
}
Fast DDS version/commit
2.8.0
Platform/Architecture
Other. Please specify in Additional context section.
Transport layer
Default configuration, UDPv4 & SHM
Additional context
Ubuntu X86 platform.
XML configuration file
Relevant log output
Network traffic capture
No response