Memory Leak using DataWriter PreviousNext
Data Distribution Service (DDS) Forum > DDS Technical Forum >
Message/Author
Next message Ralph Grewe  posted on Friday, April 17, 2009 - 12:23 pm
Hi,
we have an application for distributed video processing and i'm currently evaluating OpenSPLICE because we would like to change our own, very simple TCP transport to a more powerfull solution. I wrote a simple benchmark which sends a data stream with configurable data rate and packet size to compare our solution with an OpenSPLICE based solution. If i run the benchmark local everything works fine, but if i run it between two nodes on the network i have a problem: If i set the data rate to 8MB/s (which surely is not much) the memory used be the sending task something increases in stept until the shared memory seems to be exhausted, then the task and the OpenSPLICE daemons crash. If i increase the data rate further, the memory is used up faster.
The application i wrote is very similar to the chatter example but i'm using a listener for subscribed data instead of doing simple polling. I' sure that i missed something but until now i didn't find out what. Maybe somebody can give me a hint?

The Code for the sending part:

std::vector<packet> m_writerPacket;
std::map<unsigned> m_comWriterContainer;


ReturnCode_t status;

if (handle<1>(handle)>=m_writerPacket.size()) {
return false;
}

m_writerPacket[handle].length = length;
m_writerPacket[handle].data.length(length);
if (!m_writerPacket[handle].data.get_buffer()) {
return false;
}
memcpy(m_writerPacket[handle].data.get_buffer(), data, length);

if (m_comWriterContainer[handle]) {
status = m_comWriterContainer[handle]->write(m_writerPacket[handle], HANDLE_NIL);
if (checkStatus(status, "m_comWriterContainer[handle]->write()")) {
return false;
}
} else {
cerr << "Invalid handle, probably channel was not registered for sending" << endl;
return false;
}
return true;


Thanks in Advance,
Ralph
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Post as "Anonymous"
Enable HTML code in message
Automatically activate URLs in message
Action: