This forum has been archived. Please start a new discussion on GitHub.

A unsure question about getting data

when I got data from the ICE server all the while and the ICE server did not be started, the memory has leaked.
		public void ProcessStart()
			string [] args= new string [1];
			Ice.Communicator o_icecomm=Ice.Util.initialize(ref args);
			testIPrx p1=null;
			string sConnectstr = "" + "PCManager:default -h " + "" + " -p " + "10007";

					Ice.ObjectPrx obj = o_icecomm.stringToProxy(sConnectstr);
					p1= testIPrxHelper.uncheckedCast(obj.ice_twoway().ice_timeout(1000).ice_secure(false));       
					p1.GetAgentData();// try to connect	

Here,I do't destroy communicator in order that the Ice Server send data to the Ice clinet by callback function. I think I only create one communicator ,the memory should not be increased all the while .So I don't destroy it. That code don't include callback part,that is only my test.



  • Hi,
    I destroy the communicator ,the memory has leaked all the same.
    There is a demo.
  • How do you determine that memory leaks? What tools do you use to measure memory?
  • hi,marc
    I only observe the task manage . So I am unsure .But the memory of process do be increased certainly. That is a windows service process.
  • The task manager shows how much physical memory the Java Virtual Machine (JVM) uses. This is not a good measure for two reasons:
    • The physical memory heavily depends on the paging strategy of the operating system. See also this thread for more information.
    • The memory consumption of the JVM is not the same as the memory consumption of the Java application running in the JVM. The JVM might decide not to give back memory to the operating system, or it might give it back later. That is, from the size of the JVM you cannot deduce the memory consumption of your Ice application.
    (Whatever has been said above for the JVM is also correct for .NET, in case your example above is C# and not Java.)
  • Hi,marc
    I has read that thread. And I understand you said.But at the beginning of the memory of the process is about 13M , after many hours the memory of the process is about 50 M. The total memory increased a bout 50-13M. I doubt some don't be collect in windows service mode.
  • Hi, I unpacked your archive, built the service, installed it, and started it. I'm not seeing any increase in memory consumption, whether I run the service with or without a server it can talk to. The memory reported by task manager is stable at 13,572 kB for the service.

    So, I'm afraid that I cannot reproduce this. Do you have any more info for how to provoke the problem?


  • sorry,michi.
    It is my mistake.
    Thank you .
  • So just that in the future we can give better advice to other users who run into the same problem: What exactly was the mistake?
  • Hi,
    because other handles don't be closed in my process,not in this demo. Sorry.
    Thanks a lot.