Issue Details (XML | Word | Printable)

Key: JRA-12549
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andreas Knecht [Atlassian]
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
JIRA

JIRA leaks instances of the VelocityEngine in several places

Created: 12/Apr/07 01:15 AM   Updated: 14/May/07 11:29 PM
Component/s: Performance - Memory leaks
Affects Version/s: 3.8
Fix Version/s: 3.9

Time Tracking:
Not Specified

Issue Links:
Reference
 

Participants: Andreas Knecht [Atlassian] and tmjee
Since last comment: 2 years, 11 weeks, 2 days ago
Resolution Date: 16/Apr/07 07:10 PM
Labels:


 Description  « Hide
There's a couple of places in JIRA where we leak (or could potentially leak) the VelocityEngine directly or indirectly via the WW-ActionContext threadlocal.

These are:

  • WebWorkAdaptor.mapJellyTagToAction (finalizeContext should be in finally block)
  • JiraPluginWebworkVelocityServlet (static declaration of VelocityManager)
  • SearchContextImpl.GLOBAL_SEARCH_CONTEXT may hold on to VelocityManagers (via several links)
  • QuickLinkServlet: locally caches several managers that may hold on to the VelocityManager/Engine.


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Andreas Knecht [Atlassian] added a comment - 12/Apr/07 05:36 PM
After closer inspection, the fixes in JRA-12524 didn't do much to improve the memory situation. We basically need to also patch WebWork (the GenericDispatcher.finalizeContext()) method in particular to null the oldContextTable.

Andreas Knecht [Atlassian] added a comment - 12/Apr/07 11:41 PM
We've submitted a patch to webwork to null out the oldContextTable reference, which fixes a large part of the problem. We still need to fix the other leaks mentioned in this issue however so I'm going to leave this issue open for now.

With the fix, about 45 MB of memory could be retained.


tmjee added a comment - 15/Apr/07 08:29 PM
Hi Andreas,

Could you post the webwork jira issue id ? Thx and cheers.


Andreas Knecht [Atlassian] added a comment - 15/Apr/07 08:51 PM
I've just created the issue now: WW-1450

Andreas Knecht [Atlassian] added a comment - 16/Apr/07 07:10 PM
All remaining leaks mentioned in this issue have now been fixed. The webwork patch has also been checked in and applied.

End-Result: The instances of the VelocityEngine remaining after the func tests now retain only about 27 MB of memory vs 90 MB beforehand.