Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

Metastorm BPM forums
Sign up Latest Topics

  Author   Comment  

New Member
Posts: 1
Reply with quote  #1 


This is a code that causes memory leaks in our application.

ISessionConfigurer2 sessionConfigurer = new ESessionConfigurer();
lock (loadConfigLockObject)
sessionConfigurer.ConfigLocation = configLocation;

if (!sessionConfigurer.Ready)
  throw new Exception("something");
eclSession = sessionConfigurer.CreateSession2();
eclSession.ServiceName = serviceName;

FieldList lista = new FieldList();
lista.Add("username", new Field("username", user));
lista.Add("password", new Field("password", passwd));

   eclSession.Login("WEB;", scriptNo, lista);

// run some actions on eclSession

This code is used in our windows service and is called thousands of times a day.

I've been able to profile that this code leaves classes from Remoting namespace in memory.  Because of that we have to restart our windows service about every 10 days. Profilers show that classes from Remoting namespace go into Generation 2 and stay there forever. After some time GC starts doing full collections (Generation 2). It does not collect anything so it keeps trying over and over again thus causing high CPU usage. (We are not using Remoting in our code, so I'm 100% it's ESessionConfigurer's or ISession2's fault). As a quick check I changed the code to create only one ESessionConfigurer and one ISession2. It helped. I no longer can observe any memory leaks but I don't know if using one ESessionConfigurer and one ISession2 instance is thread safe. Our Windows service is multithreaded.

My question:

Is this known fact that ESessionConfigurer and ISession2 cause memory leaks?

Should I create one ESessionConfigurer and/or one ISession2 instance? Is it thread safe?

I have to add that we have to engines running so solution has to work with those two engines and enable load-balancing.


Avatar / Picture

Senior Member
Posts: 80
Reply with quote  #2 

Does anyone has similar problems?
Previous Topic | Next Topic

Quick Navigation:

Create your own forum with Website Toolbox!