Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-10
-
Fix Version/s: None
-
Component/s: core
-
Labels:None
-
Number of attachments :
Description
The reactor uses around 3 - 5M for each project it reactors through. This adds up if you have a behemoth like VM's 300 project build.
The temporary "solution" is to increase the amount of memory for the JVM. However this will not be sufficient for huge builds. The long term solution is to find out what the reactor is keeping references to.
Jason seems to think it is to do with interpolation.
I've done some research on this. It seems POM interpolation has some effect, but is not the majority of the memory leaked.
eg. I have a 5 project build that gets up to 23M consistently under CVS HEAD. If I comment out project = getJellyProject(project), and change all my POM interpolated values to constants, It still gets up to 21M consistently.
I've tried to make the numbers more consistent by doing a runtime.gc() before The reactor memory call.
Now, checking memory at other intervals, I have determined the ~3M that is allocated is all by loadPlugin. It seems that the plugin projects are not being let go of at the end of a project.
Is it really necessary to be reloading all the plugin projects for each project? This has the chain effect of loading other plugin projects.
I couldn't find the dangling references - I suspected project.setContext(context); context.setProject(project) - but I recursively nulled them out after the end of each reactor project and it didn't help.
I've also found that the loadedPlugins variable in the PluginManager is a little strange - using strings to key plugin + project. I thought it might be more appropriate to have a map of loaded plugins inside the project itself.
I will continue to research this - I will need to do some more heap inspection to track down what is holding on to the references, but it doesn't appear to be a trivial fix.