directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Boreham (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DIRMINA-41) Memory Leaks
Date Tue, 17 May 2005 20:04:47 GMT
     [ http://issues.apache.org/jira/browse/DIRMINA-41?page=comments#action_65612 ]
     
David Boreham commented on DIRMINA-41:
--------------------------------------

So, there's another leak in this same file, which has proven harder to fix.
I think it needs Trustin's brain to figure out the correct fix. For now we have
a hack in place that removes the leak but it also removes the nio byte buffer
pools too :(

The leak is caused by the fact that all nio.ByteBuffer objects are pushed
onto a stack when they are released. However, not all nio.ByteBuffer objects
used in allocate are pulled off the stacks. Specifically the two wrap() methods
just call the underlying java.nio.ByteBuffer wrap() methods. This results
in objects being allocated more often than they are freed and more and more
memory leaked onto the stacks. 

I'm not sure if it's just a case of adding code to try to pull a buffer off 
the stacks that can then wrap the payload, or if we need to mark the wrapper
buffers and not push them on the stack. The latter is not a good fix because
in our tests 90%+ of all the buffers were allocated via the wrap calls.




> Memory Leaks
> ------------
>
>          Key: DIRMINA-41
>          URL: http://issues.apache.org/jira/browse/DIRMINA-41
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7
>     Reporter: elliot schlegelmilch
>     Assignee: Trustin Lee
>      Fix For: 0.7.1
>  Attachments: bytebuffer.patch
>
> Discovered by adding 10,000 users and searching repeatedly. Ran in profiler and compared
mid search to post search to find many objects aren't getting gc'd.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message