Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2006

Tip: Looking for answers? Try searching our database.

Managed VC++ crashing in debug build caused memory leaks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PL - 14 Nov 2006 18:08 GMT
Hi everyone,
I was surprised to see memory leaks in our application when it crashed
today. Basically, the code is written in C#, but with c# and C++ DLLS;
its the latter (managed extensions) that cause the memory leaks (the new
operator in crtdbg.h). Does the garbage collector not work in debug build
for VC++?

TIA

Paul

Signature

----
Home: http://www.paullee.com
Woes: http://www.dr_paul_lee.btinternet.co.uk/auto.shtml

PL - 14 Nov 2006 18:09 GMT
By the way, this is using .NET framework 1.1 - we can't upgrade to 2 yet!

> Hi everyone,
> I was surprised to see memory leaks in our application when it crashed
[quoted text clipped - 6 lines]
>
> Paul

Signature

----
Home: http://www.paullee.com
Woes: http://www.dr_paul_lee.btinternet.co.uk/auto.shtml

Ben Voigt - 14 Nov 2006 20:43 GMT
> By the way, this is using .NET framework 1.1 - we can't upgrade to 2 yet!
>
[quoted text clipped - 4 lines]
>> operator in crtdbg.h). Does the garbage collector not work in debug build
>> for VC++?

Remember that only __gc objects are garbage collected, and the new operator
can also allocate from the native heap.  This is distinguished a lot better
in C++/CLI, but you said you're stuck with .NET 1.1 :(

>> TIA
>>
>> Paul
PL - 14 Nov 2006 22:21 GMT
>> By the way, this is using .NET framework 1.1 - we can't upgrade to 2 yet!
>>
[quoted text clipped - 9 lines]
> can also allocate from the native heap.  This is distinguished a lot
> better in C++/CLI, but you said you're stuck with .NET 1.1 :(

Thanks! However, it looks like all objects are declared using __gc, so maybe
the memory leaks are an artefact of compiling in debug mode only?
PL - 20 Nov 2006 19:22 GMT
It looks like all the dynamically allocated objects are decorated
with the gc moniker. I don't like to contemplate this, but does the
CLR/garbage collector not work properly in debug build?

----
Home: http://www.paullee.com
Woes: http://www.dr_paul_lee.btinternet.co.uk/auto.shtml

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.