vSphere

 View Only
  • 1.  VimService Disposal Issues

    Posted Dec 04, 2007 09:58 AM

    Hi!

    I stumbeled over som serious disposal issues for VimService and possibly ServiceContent:

    Connecting to the VimService (very) frequently via the same (windows) service, keeps the service using an increasing amount of memory.

    To dispose VimService I am using the following:

    if (_service != null)

    {

    _service.Abort();

    if(_service.Container!=null)

    _service.Container.Dispose();

    service.Logout(sic.sessionManager);

    _service.Dispose();

    _service = null;

    _sic = null;

    }

    Is there more that should be done to do a 100% cleanup?

    Thx, Tos2k



  • 2.  RE: VimService Disposal Issues

    Broadcom Employee
    Posted Dec 07, 2007 08:43 AM

    In my opinion there is nothing more to be added

    Although you can add _service.CookieContainer() but the cookie container is automatically dumped after logout.

    During logout all the properties of the service content object becomes null. e.g authorizationManger, session manager etc.

    ~ Sidharth



  • 3.  RE: VimService Disposal Issues

    Posted Dec 10, 2007 08:52 PM

    One issue may be added: Ensure to reach the Dispose() method! If for any reasons Logout() fails, it will throw an exception and possibly skip calling Dispose().

    Tos2k