Issue #337 has been updated by Stéphane Bond.

File ScriptingEvaluator_cacheBug.diff added

Here is the patch.
----------------------------------------
Bug #337: Memory leak in ScriptingEvaluator
http://tools.lsc-project.org/issues/337

Author: Stéphane Bond
Status: Resolved
Priority: High
Assigned to: Sébastien Bahloul
Category: Core
Target version: 2.0.x branch
Problem in version: 


We have integrated LSC 2.0 (trunk) in a web service to launch different 
synchronization tasks on demand. Our service calls directly SimpleSynchronize 
inside the web server, because it's faster than launching a new java process 
every time.

However, an OutOfMemory error occurs after thousands of calls. The profiler 
show that the ScriptingEvaluator.instances collection was in cause. The 
ThreadPoolExecutor generate random thread names, so the cache (which is by 
thread name) keeps thousands of ScriptingEvaluator instances.

We provide a patch to keep only the 15 last ScriptingEvaluator instances using 
an LRUMap. After the change, the server memory usage stays below 10mb, even 
after 5000 sync tasks.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://tools.lsc-project.org/my/account
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-dev mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-dev

Reply via email to