Results 1 to 2 of 2

Thread: ThreadLocalTargetSource memory issues

  1. #1
    Join Date
    Sep 2005
    Location
    Cincinnati, OH
    Posts
    1

    Default ThreadLocalTargetSource memory issues

    We are using a ThreadLocalTargetSource to inject a User bean into services that need access to it in our application. We have noticed that these User objects seem to hang around and not get cleaned up. In looking at the source code, we have a theory as to why this is. In ThreadLocalTargetSource, there is a property called targetSet that each target (User in our case) gets added to. It appears this set is only cleared by the destroy method when the BeanFactory goes away. In our case, being a Hibernate app, BeanFactory is expensive to create so we create one and get to using the SingletonBeanFactoryLocator to keep hold of it. So it appears that our User objects will just accumulate in the set for the life of our app, which is precisely what the HeapDumps seem to tell us as well. My question is: what can I do to get rid of this targetSet? What would be the downside, other than losing stats, of writing a version of ThreadLocalTargetSource, that didn't do this? Anyone have any better ideas?

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    It seems odd that you have such a large number of thread-bound target misses that targets are accumulating. What is your environment and what is your requirement for the ThreadLocalTargetSource?
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Similar Threads

  1. Issues with multithreading and controllers?
    By brianstclair in forum Web
    Replies: 16
    Last Post: Feb 19th, 2010, 10:57 AM
  2. Memory consumption using JmsTemplate
    By scornflake in forum Remoting
    Replies: 4
    Last Post: Sep 13th, 2007, 08:04 AM
  3. Memory leak using RMI
    By josep in forum Remoting
    Replies: 4
    Last Post: May 29th, 2007, 10:51 AM
  4. Memory leaks when redeploying web applications
    By adepue in forum Container
    Replies: 5
    Last Post: Sep 6th, 2005, 05:06 AM
  5. Possible memory leak with SLSB on WL5.1
    By skaffman in forum EJB
    Replies: 5
    Last Post: Aug 15th, 2005, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •