activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: ActiveMQ-CPP 3.4.2 memory leaks?
Date Sun, 13 May 2012 15:45:08 GMT
On Sun, 2012-05-13 at 07:32 -0700, richardm wrote: 
> Thanks Tim,
> 
> I'm new to the group.  Does this mean that most of the development is done
> on Linux?  This might be a Windows (Microsoft) -specific issue.
> 
> My tools are not that good, though I'll spend some time later today or
> tomorrow to better understanding what I'm seeing.  All I know is that the
> most basic dump of leaked memory indicates quite a few problems in the
> Visual Studio environment.  I'm guessing this to be the same issue that I'm
> bumping up against in my program.
> 
> If there's anyone else who has useful Windows tools, any effort would be
> most helpful.  I've described my changes to the program below.
> 
> 
> Richard
> 
> 

Yes, the code is primarily developed on Linux, and tested with Valgrind
there quite frequently.  Its possible there is some leak in the Windows
specific portions or the MS tooling is just giving you false positives.
Not sure if there is anything like Valgrind that is free on Windows.  


> ---------------------------------
> 
> What I have done is put the following the declarative section of the program
> (line 41, after #includes):
> 
> #ifdef _DEBUG
> #ifndef DEBUG_NEW
> #include <stdlib.h>
> #include <crtdbg.h>
> 
> #define _CRTDBG_MAP_ALLOC
> #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
> #define new DEBUG_NEW
> #endif
> #endif 
> 
> And then the following at the bottom of main():
> 
> #ifdef _DEBUG
> _CrtDumpMemoryLeaks();
> #endif
> 
> In reality the first change needs to be installed in all the ActiveMQ-cpp
> source code, but I haven't reached that point yet.  This is a simplistic
> approach to instruct the memory allocator to track memory usage and then to
> dump the display leakage.  (google for more details.)
> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CPP-3-4-2-memory-leaks-tp4630355p4630522.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | FuseSource Corp
tim.bish@fusesource.com | www.fusesource.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Mime
View raw message