Issue Details (XML | Word | Printable)

Key: JRA-12411
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Jed Wesley-Smith [Atlassian]
Reporter: Jed Wesley-Smith [Atlassian]
Votes: 2
Watchers: 3
Operations

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

OutOfMemoryError during reindex all (due to EagerLoadingOfbizCustomFieldPersister's caching of custom field values)

Created: 21/Mar/07 12:49 AM   Updated: 12/Dec/07 09:24 PM
Component/s: Custom Fields, Filtering & Indexing, Performance - Memory leaks
Affects Version/s: 3.6, 3.7, 3.8
Fix Version/s: 3.8.1

Time Tracking:
Not Specified

File Attachments: 1. File EagerLoadingOfBizCustomFieldPersister.class (5 kB)
2. File EagerLoadingOfBizCustomFieldPersister_CacheKey.class (1 kB)

Environment: All

Participants: Jed Wesley-Smith [Atlassian]
Since last comment: 1 year, 21 weeks ago
Resolution Date: 27/Mar/07 11:12 PM
Labels:


 Description  « Hide
The EagerLoadingOfbizCustomFieldPersister is storing an Issue's custom field values in a ThreadLocal so a request may access the same values in a timely manner if requested again. Unfortunately a reindex all process touches every issue, slowly building these caches up and not releasing until either the reindex thread pool is discarded and the threads die or an OutOfMemoryError occurs. We should really SoftReference the list of values.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jed Wesley-Smith [Atlassian] added a comment - 21/Mar/07 06:35 PM
a SoftReference to the list of values for an issue is now stored into the map, tested with large data-set and now works correctly.

Jed Wesley-Smith [Atlassian] added a comment - 22/Mar/07 08:47 PM
The fix does not preserve backwards-compatability. In particular the case of a null issueID no longer queries the database. This should definitely happen, even though there should never be any custom field values with a null issueID, the EagerLoadingOfBizCustomFieldPersister should not encode this logic.

Jed Wesley-Smith [Atlassian] added a comment - 27/Mar/07 11:12 PM
Now correctly calls through to the database with a null id

Jed Wesley-Smith [Atlassian] added a comment - 14/May/07 10:49 PM - edited
Attached is a patch that will work for JIRA 3.7.x

If you are using JIRA Standalone please do the following:

1. Download the attached EagerLoadingOfBizCustomFieldPersister*class files
2. Rename EagerLoadingOfBizCustomFieldPersister_CacheKey.class to EagerLoadingOfBizCustomFieldPersister$CacheKey.class
3. Copy the files to <jira_install_dir>/atlassian-jira/WEB-INF/classes/com/atlassian/jira/issue/customfields/persistence/ overwriting the files there
4. Restart JIRA

If you are using the WAR distribution of JIRA please do the following:

1. Download the attached EagerLoadingOfBizCustomFieldPersister*class files
2. Rename EagerLoadingOfBizCustomFieldPersister_CacheKey.class to EagerLoadingOfBizCustomFieldPersister$CacheKey.class
3. Copy the files to <jira_install_dir>/webapp/WEB-INF/com/atlassian/jira/issue/customfields/persistence/ overwriting the files there
4. Run 'build.sh clean' on unix or 'build.bat clean' on windows
5. Run 'build.sh' on unix or 'build.bat' on windows
6. Redeploy the JIRA web app into your application server
7. Restart the application server