Archived
This forum has been archived. Please start a new discussion on GitHub.
How to release object.
o_icecomm = Ice.Util.initialize(ref arg); Ice.ObjectPrx obj = o_icecomm.stringToProxy(sConnectstr); PCManagerPrx PCmanager= PCManagerPrxHelper.checkedCast(obj); Ice.ObjectAdapter adapter = o_icecomm.createObjectAdapterWithEndpoints("PCManagerAdapter","tcp:udp"); adapter.add(new ServerCallBackI(PCmanager),Ice.Util.stringToIdentity("servercallback")); adapter.activate();how to release the objects: obj ,PCmanager,adapter.
0
Comments
-
You don't need to release objects explicitly with Ice. You can simply let the references go out of scope, and Ice will clean up for you. The only explicit cleanup action that is required on your part is that you must destroy the communicator before exiting. Please check out the documentation for more details.
Cheers,
Michi.0 -
Thanks ,but I want to release that objects by myself. May I do it?0
-
Another,Will the communications Handle be create when I execute that code ? How do I close the Handles0
-
You seem to be working with Java, so I don't understand the question. Java has automatic garbage collection. What exactly do you mean with "release"?0
-
marc wrote:You seem to be working with Java, so I don't understand the question. Java has automatic garbage collection. What exactly do you mean with "release"?0
-
Sorry, I'm confused. Whether you run an Ice program as a stand-alone program or as a Windows service makes no difference. The C# garbage collector runs regardless. What makes you think that you need to release anything?
Cheers,
Michi.0 -
michi wrote:Sorry, I'm confused. Whether you run an Ice program as a stand-alone program or as a Windows service makes no difference. The C# garbage collector runs regardless. What makes you think that you need to release anything?
Cheers,
Michi.
I'm confused too.
when I run my program as a Windows service ,I observe Handle Count in Task Manager. The handle count is increased at all times.But I run an Ice program as a stand-alone program ,the Handle count is increased or decreased. so I want to Know the handle exist in ICE or not.0 -
It is impossible to leak memory (or any other resources) with Ice for C#. I suspect that the problem may be elsewhere in your server. Or are you leaking servants? In that case, I suggest you read Connections #3, which discusses how to get rid of servants that are no longer needed by clients.
Cheers,
Michi.0 -
Thank you.
I am reading it now.0