Resources are not cleaned up when write() is called from a spawned thread

If the logic of your application requires to spawn new threads, and in those threads you are calling a DDS API such as write(), you may notice a memory growth. 

To ensure that all the resources allocated in that thread are correctly released, remember to call unregister_thread() right before exiting the thread.

Here is what the full API looks like:

DDS_ReturnCode_t DDS_DomainParticipantFactory_unregister_thread(DDS_DomainParticipantFactory * 	self);	

For more infromation have a look to the online references here