OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000555OMNeT++simulation kernelpublic2012-03-27 09:592012-03-27 10:07
Reporterandras 
Assigned Toandras 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.2.1 
Target VersionFixed in Version4.2.2 
Summary0000555: Memory leak in output vector recording
DescriptionOutput vectors leak memory when they are destroyed. This causes problems for simulations that continuously create new output vectors at runtime -- their process size will inflate. A workaround is to set per-vector buffer limit to the minimum (1).

Reported by David Eckhoff.
TagsNo tags attached.
Attached Filespatch file icon omnetpp.patch [^] (986 bytes) 2012-03-27 10:07 [Show Content]
patch file icon vector.patch [^] (1,731 bytes) 2012-03-27 10:07 [Show Content]

- Relationships

-  Notes
(0000744)
andras (administrator)
2012-03-27 10:06

From David Eckhoff:

I attached a patch for OMNeT++ 4.2 to modify some code and add a "memcheck" shell script to reproduce my output (cd samples/aloha; patch -p0 vector.patch; sh memcheck).

Executing the line in the memcheck file records statistics to valgrind.out. I attached an excerpt in valgrind.txt.

When uncommenting line 68 in Host.cc, that is doubling the number of recorded values, the amount of bytes 'totally lost' almost doubles, too.
I therefore conclude that its indeed the buffer.

Christoph and I dug a little deeper into the OMNeT++ code and we found something we think causes the memory leak:

cIndexedFileOutputVectorManager inherits from cFileOutputVectorManager and its sVector class inherits from the sVectorData class.

However, sVectorData has no virtual destructor.

The deregisterVector function (src/envir/fileoutvectormgr.cc:166) casts to sVectorData*, causing the destructor of sVector never to be called.
The buffer is therefore not deleted. I attached a patch (omnetpp.patch) that should fix the problem and close the memory leak.
(0000745)
andras (administrator)
2012-03-27 10:07

Patch applied.

- Issue History
Date Modified Username Field Change
2012-03-27 09:59 andras New Issue
2012-03-27 10:06 andras Note Added: 0000744
2012-03-27 10:07 andras File Added: omnetpp.patch
2012-03-27 10:07 andras File Added: vector.patch
2012-03-27 10:07 andras Note Added: 0000745
2012-03-27 10:07 andras Status new => resolved
2012-03-27 10:07 andras Fixed in Version => 4.2.2
2012-03-27 10:07 andras Resolution open => fixed
2012-03-27 10:07 andras Assigned To => andras


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker