Issue Details (XML | Word | Printable)

Key: JAMES-268
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Noel J. Bergman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JAMES Server

Spooler.accept(...) can leave locked messages and leak memory

Created: 22/Apr/04 12:42 AM   Updated: 05/Jun/04 07:29 PM
Return to search
Component/s: MailStore & MailRepository
Affects Version/s: 2.2.0
Fix Version/s: 2.2.0

Time Tracking:
Not Specified

Resolution Date: 22/Apr/04 01:50 AM


 Description  « Hide
I believe there is a memory leak under an error condition in the spooler that I'll be fixing, but that should be able to wait for a 2.2.1. If I am correct, the nature of the error is here:

 if (lock(s)) {
     MailImpl mail = null;
     try {
        mail = retrieve(s);
     } catch (javax.mail.MessagingException e) {
       ...
     }
     if (mail == null) {
        continue;
     }

If retrieve returns null or throws an exception, the lock is kept, and we leak memory. Also ...

     if (filter.accept (mail.getName(),
                        mail.getState(),
                        mail.getLastUpdated().getTime(),
                        mail.getErrorMessage())) {
        return mail;
     }

If the filter doesn't accept, we leak the lock info, although we'll eventually clean it up. The problem here is that the message is forever locked for this specific thread.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Noel J. Bergman added a comment - 22/Apr/04 01:50 AM
Committed fix to CVS. Initial tests appear to indicate that all is well.