java code:
Ice.Communicator ic =Ice.Util.initialize(args);
Ice.ObjectPrx tmp = ic.stringToProxy("DemoGlacier2/router:tcp -p 4064 -h 127.0.0.1");
RouterPrx router = RouterPrxHelper.checkedCast(tmp);
try {
SessionPrx session = router.createSession("a", "b");
Ice.ObjectPrx base = ic.stringToProxy("callback:tcp -h 127.0.0.1 -p 10000").ice_router(router);
CallbackPrx twoway = CallbackPrxHelper.checkedCast(base);
} catch (CannotCreateSessionException e) {
e.printStackTrace();
} catch (PermissionDeniedException e) {
e.printStackTrace();
}finally{
if (router != null) {
try {
router.destroySession();
} catch (Throwable ex) {
}
router = null;
}
if (ic != null) {
try {
ic.destroy();
} catch (Throwable ex) {
}
ic = null;
}
}
run >=10000w times,"glacier2router.exe" use more and more Memory,at last "glacier2router.exe" is no response.exception:
Caused by: Ice.ConnectionLostException
error = 0
at IceInternal.ConnectRequestHandler.getConnection(Co nnectRequestHandler.java:240)
at IceInternal.ConnectRequestHandler.sendRequest(Conn ectRequestHandler.java:138)
at IceInternal.Outgoing.invoke(Outgoing.java:66)
at Glacier2._RouterDelM.createSession(_RouterDelM.jav a:44)
client invoke destroy() free memory,but glacier2router.exe does not free memory.
I wonder whether the problem is glacier2router.exe config was wrong, or glacier2router.exe has bug?

Reply With Quote
