Anonymous | Login | 2022-08-10 09:12 UTC | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000555 | OMNeT++ | simulation kernel | public | 2012-03-27 09:59 | 2012-03-27 10:07 | ||||
Reporter | andras | ||||||||
Assigned To | andras | ||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | 4.2.1 | ||||||||
Target Version | Fixed in Version | 4.2.2 | |||||||
Summary | 0000555: Memory leak in output vector recording | ||||||||
Description | Output 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. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() ![]() | ||||||||
![]() |
|
(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. |
![]() |
|||
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 - 2022 MantisBT Team |