Dr. Memory works with MingW+windows. That's good. How do I read the report?

630 views
Skip to first unread message

Dan

unread,
May 6, 2011, 7:24:14 AM5/6/11
to Dr. Memory Users
HI, Derek and all,


How glad to find Dr. Memroy and the group. I just start to use Dr.
Memory to solve the memory problem of my wireless network simulation
programme.

My problem is memeory leak (I believe). When I run the programme for
a long time (e.g. 3 hours), the memory usage steadily increases to
very large (e.g.,2 GB) and then crashes. It seems some object is not
deleted and never used.

Installing Dr. Memroy went very well and I have got a report as
follows (It seems that Dr. Memory works very well and detect some
leaks). My question is how can I read the these lines e.g.
----------------------------------------
0x03aec976 <libmiximbase.dll+0x1c976> libmiximbase.dll!
ZN12MappingUtils13createMappingEdRK12DimensionSetN7Mapping19InterpolationMethodE
??:0
----------------------------------------

From these lines, Can I tell where the bug is in my source code?

Note: my programme is developed at Windows+Mingwin environment, using
the open source OMNeT++ simulator to simulate wireless network.
myWSN.exe is my programme, which calling lixmiximbase.dll which
calling liboppsimd.dll and so on..

-----------------------------------------
Error #378: POSSIBLE LEAK 80 direct bytes 0x059c0010-0x059c0060 + 20
indirect bytes
0x6ce1bacf <libstdc++_sjlj_6.dll+0x1bacf> libstdc++_sjlj_6.dll!Znwj
??:0
0x03aec976 <libmiximbase.dll+0x1c976> libmiximbase.dll!
ZN12MappingUtils13createMappingEdRK12DimensionSetN7Mapping19InterpolationMethodE
??:0
0x00430081 <myWSN.exe+0x30081> myWSN.exe!?
??:0
0x0042fb31 <myWSN.exe+0x2fb31> myWSN.exe!?
??:0
0x03ae3757 <libmiximbase.dll+0x13757> libmiximbase.dll!
ZN12BasePhyLayer15getChannelStateEv
??:0
0x0040eede <myWSN.exe+0xeede> myWSN.exe!?
??:0
0x00410665 <myWSN.exe+0x10665> myWSN.exe!?
??:0
0x03ad6fd4 <libmiximbase.dll+0x6fd4> libmiximbase.dll!
ZN9BaseLayer13handleMessageEP8cMessage
??:0
0x6a8a07d2 <liboppsimd.dll+0x607d2> liboppsimd.dll!
ZN11cSimulation10doOneEventEP13cSimpleModule
??:0
0x66642daf <liboppcmdenvd.dll+0x2daf> liboppcmdenvd.dll!
ZN6Cmdenv8simulateEv
??:0
0x666438a8 <liboppcmdenvd.dll+0x38a8> liboppcmdenvd.dll!
ZN6Cmdenv3runEv
??:0
0x0164d595 <liboppenvird.dll+0xd595> liboppenvird.dll!
ZN9EnvirBase3runEiPPcP14cConfiguration
??:0
---------------------------------------

Derek Bruening

unread,
May 6, 2011, 10:31:07 AM5/6/11
to drmemor...@googlegroups.com
On Fri, May 06, 2011 at 04:24:14AM -0700, Dan wrote:
> My problem is memeory leak (I believe). When I run the programme for
> a long time (e.g. 3 hours), the memory usage steadily increases to
> very large (e.g.,2 GB) and then crashes. It seems some object is not
> deleted and never used.

This could be from memory leak(s), where your program loses pointers to
memory objects. It could also be memory accumulation without any "leak"
(according to Dr. Memory's definition, because you still have pointers to
all your memory). If Dr. Memory doesn't find enough leaks to explain it,
you may want to investigate the accumulation scenario with a heap profiling
tool. (I am developing one that shares the Dr. Memory infrastructure
called Dr. Heapstat. It has a feature called "staleness detection" where
it tells you how long it's been since your program accessed each memory
object. But, it's not fully polished, mainly in visualizing the data.)

> My question is how can I read the these lines e.g.
> ----------------------------------------
> 0x03aec976 <libmiximbase.dll+0x1c976> libmiximbase.dll!
> ZN12MappingUtils13createMappingEdRK12DimensionSetN7Mapping19InterpolationMethodE
> ??:0
> ----------------------------------------

The regular Windows Dr. Memory (front-end "drmemory.exe") currently only
understands the Microsoft PDB symbol format, so the problem here is that
the tool is not resolving symbols for you, resulting in mangled C++ names
and no line numbers.

For mingw or cygwin my solution in the past was to use a separate
Dr. Memory build that runs addr2line (front-end "drmemory.pl") but I have
not had time to fully support it so I did not include it in the official
release package. There is an older build here that may work:

http://drmemory.googlecode.com/files/DrMemory-Cygwin-1.3.0-2.zip

The other option is to run the raw addresses through addr2line (from mingw)
manually or via a script. Let us know if you're not sure how to do this.

Eventually Dr. Memory will fully support mingw and cygwin apps.

- Derek

Reply all
Reply to author
Forward
0 new messages