|
|
|
|||||
|
A question about decrease memory
My program includes many ICE client.
I find when I execute this code to create ICE client: o_icecomm = Ice.Util.initialize(ref arg); Ice.ObjectPrx obj = o_icecomm.stringToProxy(sConnectstr); PCManagerPrx PCmanager= PCManagerPrxHelper.checkedCast(obj);//end ,The memoy increase. As the Clients of ICE increase ,the memory of the program increase. I think if I create 200 clients of ICE in the program ,the memory is about 400M. So .my computer is very "slow"! In the case, how can I decrease the memory? thanks! |
|
|||||
|
I don't understand how do I share a single communicator object instead of creating 200 of them. I need many conncetors when my parogram has been executed,not one connector. So my communicators will be destroy only that the program is closed.or the server program is closed.
|
|
||||||
|
Perhaps I misunderstood your original post but I was under the impression that you were creating 200 communicators within the same process, in which case you could simply use a single shared communicator instead (even if you're connecting to multiple servers...).
Is your application actually creating 200 processes, each process being an Ice client connecting an Ice server? I'm not sure what is your concern with respect to memory in this case... Can you detail a little more your application so that we can better help you? Benoit. |
|
|||||
|
Code:
public void createICEagent()
{
string ConnectIP=string.empty;
IList lstIp=new ArrayList();
Ice.Communicator o_icecomm = null;
o_icecomm = Ice.Util.initialize(ref arg);
lstIp.Add("172.16.16.16");
lstIp.Add("172.16.16.12");
lstIp.Add("172.16.16.13");
lstIp.Add("172.16.16.15");
for(int i=0;i<lstIp.Count;i++)
{
try
{
ConnectIP=lstIp[i];
Ice.ObjectPrx obj = o_icecomm.stringToProxy(ConnectIP);
PCManagerPrx PCmanager= PCManagerPrxHelper.checkedCast(obj);
}
catch
{
}
}
|
|
||||||
|
I suppose that by Ice "client" you actually mean Ice "proxy". I don't see why creating a proxy and doing a checkedCast on this proxy would consume a lot of memory -- it shouldn't.
The best way to investigate this problem would be to send us a small self-compilable example demonstrating it, please also specify which OS and Ice version you are using. Btw, I'm not sure if is intended or not, but "172.16.16.15" is a stringified proxy representing an indirect proxy containing only the object identity "172.16.16.15" (it's not interpreted as an IP address!). If your goal is to invoke on an object which is hosted by the host with the "172.16.16.15" IP address, the proxy should be something like: "myobject:tcp -h 172.16.16.15 -p 12345" where "myobject" if the identity of the object. Benoit. Last edited by benoit : 06-27-2005 at 08:02 AM. Reason: fixed wrong proxy |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ice should decrease port | hellocyf | Comments | 5 | 11-07-2006 05:58 AM |
| A question about memory limit in Ice. | ehero | Help Center | 3 | 06-28-2005 11:35 AM |
| a question about memory | laotee | Help Center | 8 | 06-22-2005 11:17 PM |
| Mismatched memory question | stephan | Help Center | 6 | 03-28-2005 09:14 PM |
| question about memory mgmt | Baloo | Help Center | 2 | 10-01-2004 07:02 PM |