Home Help Center

Ice.GC.Interval Not working as expected.

adahmaniadahmani Member Abdel DahmaniOrganization: RBCProject: RBC

I am currently using Ice Runtime 3.2.1 and I am experiencing the following issue.

There is a cyclic dependency that has been introduced in the current Ice Objects causing a Memory leak.
Classes are written in C++.

If I make a call to Ice::collectGarbage() I can see the memory footprint going down.
This implies that the Garbage Collector is doing its work perfectly well as expected.

Ideally I don't want to be calling Ice::collectGarbage() within the code.
The document recommend using Ice.GC.Interval property.

I have set-up this property Ice.GC.Interval=5 in the Ice Property File and this seems not to cause the Garbage Collector to be run.
I have also tried to set the Property by code props->setProperty("Ice.GC.Interval", "5") without any success.

Many thanks for your assistance.


  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    Welcome to the forum.

    Note that the only setting for Ice.GC.Interval that has any effect is in the very first communicator that a program initializes. You won't need to worry about this if you're only initializing one communicator.

    Have you tried setting Ice.Trace.GC=1 to see if any log messages are generated?

  • adahmaniadahmani Member Abdel DahmaniOrganization: RBCProject: RBC
    Hi Mes,

    Thanks for your reply.

    I have now found the root cause of the problem, thanks for pointing me in the right direction.

    The issue is that our system contains several communicator and I was focusing on the last communicator that was created in our system.

    Once I ensure that the first communicator get initialized with the proper property Ice.GC.Interval=5 it works perfectly well.

    Many thanks for your help.
Sign In or Register to comment.