Memory Leak in WebServices
Posted: Fri Apr 24, 2009 2:24 am
I have been testing creating and sending Mailings using the webservices. One problem is that it takes 2 webservice calls for each subscriber I want to add (one to create and one to 'bind'). Then, while doing some load testing, I started getting OOM Exceptions, even though OpenEMM was running with xmx at 1.5 Gb. So I did a little profiling, and have noticed that after about 50k webservice calls (creating a mailing with 25k subscribers), the 'usedConnections' Hashtable managed by the WebServiceBase is holding on to 500Mb of RAM!
I imagine this Hashtable is maintained for some kind of webservice troubleshooting -- it appears to put a stacktrace in the Hashtable for each webservice call. But for some reason, the 'remove' is either not getting called or not working.
This probably wouldn't have shown up as a problem if there were an API that could be called to add more than one subscriber at a time. I was always dubious of using this double-ws call per subscriber, and now it looks like I'll be going around the API for this, as well as removing the usedConnections Hashtable itself, unless someone can demonstrate that it does something useful.
I imagine this Hashtable is maintained for some kind of webservice troubleshooting -- it appears to put a stacktrace in the Hashtable for each webservice call. But for some reason, the 'remove' is either not getting called or not working.
This probably wouldn't have shown up as a problem if there were an API that could be called to add more than one subscriber at a time. I was always dubious of using this double-ws call per subscriber, and now it looks like I'll be going around the API for this, as well as removing the usedConnections Hashtable itself, unless someone can demonstrate that it does something useful.
