Jump to content
OpenSplice DDS Forum


  • Content count

  • Joined

  • Last visited

About payne

  • Rank

Profile Information

  • Company
  1. helloworld standalone example memory leak

    Hi hans, Thank you for your suggestions. The code I modified is simple, I just make the publisher and subscriber can be always running, and the MAX_NUM is 300. How can I unregister() or take() the samples to reduce the memory usage? BTW, the topic QOS of the example is set RELIABLE_RELIABILITY_QOS and TRANSIENT_DURABILITY_QOS, and I comment out the TRANSIENT_DURABILITY_QOS. publisher: while (true) { msgInstance.userID = index++; msgInstance.timestamp = getCurrentTime(); for (int i = 0; i < MAX_NUM; i++) { status = HelloWorldWriter->write(msgInstance, DDS::HANDLE_NIL); checkStatus(status, "MsgDataWriter::write"); os_nanoSleep(delay_1ms); } /*cout << "=== [Publisher] writing a message containing :" << endl; cout << " userID : " << msgInstance.userID << endl; cout << " Message : \"" << msgInstance.message << "\"" << endl;*/ os_nanoSleep(delay_700ms); } subscriber: while (!closed && count < 1500) // We dont want the example to run indefinitely { for (int i = 0; i < MAX_NUM; i++) { status = HelloWorldReader->take(msgList, infoSeq, LENGTH_UNLIMITED, ANY_SAMPLE_STATE, ANY_VIEW_STATE, ANY_INSTANCE_STATE); checkStatus(status, "msgDataReader::take"); for (DDS::ULong j = 0; j < msgList.length(); j++) { /*cout << "=== [Subscriber] message received :" << endl; cout << " userID : " << msgList[j].userID << endl; cout << " Message : \"" << msgList[j].message << "\"" << endl;*/ outfile << "topic" << i << " " << msgList[j].userID << " " << msgList[j].message << /* " " << msgList[j].timestamp << " " << getCurrentTime() << " " << msgList[j].buf <<*/ endl; //closed = true; } status = HelloWorldReader->return_loan(msgList, infoSeq); checkStatus(status, "MsgDataReader::return_loan"); } os_nanoSleep(delay_1ms); //++count; } IDL: module Simulator{ typedef char array1024[1024]; struct Message { long msgId; array1024 msg; }; #pragma keylist Message msgId };
  2. Hi all, I am using 6.7.1 community version to do some tests, I modified the helloworld standalone example under "\examples\dcps\helloworld\cpp", the program will send 300 samples(or called message?) of 300 topics in a second, and each sample(or called message?) is about 1k byte. After running about 1 hour, the memory usage of the applications(both of sacpp_helloworld_pub.exe and sacpp_helloworld_sub.exe) are more than 1GB, while at the beginning, they were about 6MB. Does anyone know what's the problem? Do I need to do some configurations to avoid the memory leakļ¼Ÿ I just use the default ospl.xml as the OSPL_URI value, the content as show below: <OpenSplice> <Domain> <Name>ospl_sp_ddsi</Name> <Id>0</Id> <SingleProcess>true</SingleProcess> <Description>Stand-alone 'single-process' deployment and standard DDSI networking.</Description> <Service name="ddsi2"> <Command>ddsi2</Command> </Service> <Service name="cmsoap"> <Command>cmsoap</Command> </Service> <DurablePolicies> <Policy obtain="*.*"/> </DurablePolicies> </Domain> <DDSI2Service name="ddsi2"> <General> <NetworkInterfaceAddress>AUTO</NetworkInterfaceAddress> <AllowMulticast>true</AllowMulticast> <EnableMulticastLoopback>true</EnableMulticastLoopback> <CoexistWithNativeNetworking>false</CoexistWithNativeNetworking> </General> <Compatibility> <!-- see the release notes and/or the OpenSplice configurator on DDSI interoperability --> <StandardsConformance>lax</StandardsConformance> <!-- the following one is necessary only for TwinOaks CoreDX DDS compatibility --> <!-- <ExplicitlyPublishQosSetToDefault>true</ExplicitlyPublishQosSetToDefault> --> </Compatibility> </DDSI2Service> <TunerService name="cmsoap"> <Server> <PortNr>Auto</PortNr> </Server> </TunerService> </OpenSplice> Sorry for my poor English, and thank you for your great help.
  3. Hi guys, I am using the 6.7.1 community version, and I use TCP protocol, because I have two publishers run in the same PC, so I have to set the <Port> element to "0" to dynamically allocate ports, but I don't know how to configure the subscriber application to discovery the publishers and build connections(run in other PCs). My publisher configuration(IP: <DDSI2Service name="ddsi2"> ... <TCP> <Enable>true</Enable> <Port>0</Port> <NoDelay>true</NoDelay> </TCP> and my subscriber configuration: <TCP> <Enable>true</Enable> <NoDelay>true</NoDelay> </TCP> <Discovery> <Peers> <Peer Address=""/> </Peers> </Discovery> but it doesn't work, and I can not subscribe the message from the server, I think the problem should be about how to discovery the port of the publishers. can somebody help me about this? Thanks, Payne