473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Memory Release of C# objects used by MC++

Hi,
We have a class written in MC++ that has a data member of a class written in
C#.
When the MC++ goes out of scope, it's destructor is properly called and it's
memory is released. However, the C# class Dispose() never gets called, and
therefore it's memory is never released.
Is this a known issue? Are we doing something wrong? or do we always have
to explicitly call Dispose() on all C# objects embedded in MC++ classes?
Currently this is a major issue since our application need to run 24x7.
Any help will be appreciated. Thanks. Eyal.
Nov 17 '05 #1
1 1008

"Eyal" <Ey**@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
Hi,
We have a class written in MC++ that has a data member of a class written
in
C#.
When the MC++ goes out of scope, it's destructor is properly called and
it's
memory is released. However, the C# class Dispose() never gets called, and
therefore it's memory is never released.
Is this a known issue? Are we doing something wrong? or do we always have
to explicitly call Dispose() on all C# objects embedded in MC++ classes?
Currently this is a major issue since our application need to run 24x7.
Any help will be appreciated. Thanks. Eyal.


If you're using VC++ 7.1 (.NET 2003) then you need to explicitly call
IDisposable::Dispose on the object references you hold.

In VC++ 8.0 (2005), the destructor will automatically call Dispose for you.

-cd
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but...
3
by: Marc | last post by:
I am using Visual Studio 2003 with .NET Framework 1.x on XP SP2. I am executing the following code (see also http://dturini.blogspot.com/2004/06/on-past-few-days-im-dealing-with-som e.html) ...
4
by: Sean | last post by:
I am a little bit confused about memory clean up in VB.NET. (Damn I never thought I'd miss News and Deletes from VC++, but at least I was sure there). If I have some code like: Public...
7
by: Fernando Barsoba | last post by:
Hi, After following the advice received in this list, I have isolated the memory leak problem I am having. I am also using MEMWATCH and I think it is working properly. The program does some...
30
by: MAG1301 | last post by:
I've detected memory leaks in our huge .NET 1.1 C# application but couldn't localize them directly. So I've reduced the code to the following console application: using System; using System.IO;...
3
by: simchajoy2000 | last post by:
Hi, I have found that sometimes and usually on an inconsistent basis, VB.NET projects will hold onto objects after I have disposed of them in code doing something like: object.close object =...
8
by: Lauren the Ravishing | last post by:
Hi, In ASP, is it absolutely necessary to set an object to Nothing after being used? set myObj = server.createObject("myDLL.myClass") call myObj.useClass set myObj = Nothing <--- can I...
17
by: frederic.pica | last post by:
Greets, I've some troubles getting my memory freed by python, how can I force it to release the memory ? I've tried del and gc.collect() with no success. Here is a code sample, parsing an XML...
5
by: cham | last post by:
Hi, I am working on c++ in a linux system ( Fedora core 4 ), kernel version - 2.6.11-1.1369_FC4 gcc version - 4.0.0 20050519 ( Red Hat 4.0.0-8 ) In my code i am creating a vector to store...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.