.NET Remoting - host do not free remote objects alocated memory

P

Przemek

Hi,
I writing in CLI/C++ [VS2005] and I found a little problem in my app.
I working with NET Remoting (System::Runtime::Remoting namespace) and the
problem is:
I set all the information about object lifetime in my appdomain (my Host
domain) like this:

<code>
LifetimeServices::LeaseTime = System::TimeSpan::FromMinutes(7);
LifetimeServices::RenewOnCallTime = System::TimeSpan::FromMinutes(3);
<code\>

It works correct and I can't acces to object after 7 mins or 3 mins after
last call - it's ok so I think LifeTime services is set corectly - but when
I look on memory usage of my Host application process it's nothing change!
Ater lose connection to my remote objects (correct end of life time) Host
memory is not released by GC!
Host still get 80-90 MBs of RAM after few clients calls and not destructed
object. So - if lifetime is finish - I lose connection to my object and
memory should be free by GC - but it isn't! - host process memory is the
same even after half hour!.
This problem doesn't appear when client call remote object destructor
(delete myRemoteObject) programaticly - then memory is release.

<code>
MyRemoteClass ^remoteObject = gcnew MyremoteObject(); // create remote
obj
// work
delete remoteObject; // destruction of my emote obj with memory release
on server side
<code/>

But natural is, tahat I can't delete the object always - not in situation
when client app loose net connection or
just hang up! Then object isn't collected by GC and still get host memory.
What to do?
thanx - PP.MM.
 
K

Kai-Uwe Bux

Przemek said:
Hi,
I writing in CLI/C++ [VS2005] and I found a little problem in my app.
I working with NET Remoting (System::Runtime::Remoting namespace) and the
problem is: [snip]
Then object isn't collected by GC and still get host memory.
What to do?

Post in a group where your question is on-topic. You will be much better off
there.

This group discusses standard C++ not CLI/C++. In particular, garbage
collection is not part of C++ and neither are library components in the
System::... hierarchy.

You might find good suggestions for where to ask your question in the FAQ

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9


Best

Kai-Uwe Bux
 
T

terminator

Hi,
I writing in CLI/C++ [VS2005] and I found a little problem in my app.
I working with NET Remoting (System::Runtime::Remoting namespace) and the
problem is:
I set all the information about object lifetime in my appdomain (my Host
domain) like this:

<code>
LifetimeServices::LeaseTime = System::TimeSpan::FromMinutes(7);
LifetimeServices::RenewOnCallTime = System::TimeSpan::FromMinutes(3);
<code\>

It works correct and I can't acces to object after 7 mins or 3 mins after
last call - it's ok so I think LifeTime services is set corectly - but when
I look on memory usage of my Host application process it's nothing change!
Ater lose connection to my remote objects (correct end of life time) Host
memory is not released by GC!
Host still get 80-90 MBs of RAM after few clients calls and not destructed
object. So - if lifetime is finish - I lose connection to my object and
memory should be free by GC - but it isn't! - host process memory is the
same even after half hour!.
This problem doesn't appear when client call remote object destructor
(delete myRemoteObject) programaticly - then memory is release.

<code>
MyRemoteClass ^remoteObject = gcnew MyremoteObject(); // create remote
obj
// work
delete remoteObject; // destruction of my emote obj with memory release
on server side
<code/>

But natural is, tahat I can't delete the object always - not in situation
when client app loose net connection or
just hang up! Then object isn't collected by GC and still get host memory.
What to do?
thanx - PP.MM.

http://groups.google.com/group/microsoft.public.dotnet.languages.vc?lnk=iggc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top