@kohsuke I've got a pretty good handle on what is going on here but don't know enough about how maven multi-module projects fit together to get to the bottom of the issue.

I can re-create the issue by simulating a low memory situation which forces soft-references to get cleared (i.e. cause an OOM) and then after that requesting the rssAll URL will cause the problem. This does require that the jenkins instance has some multi-module maven builds.

http://localhost:8080/jenkins/rssAll

Note that the single module builds all seem to be fine and have build history (indeed the top level build history of the multi-module looks fine). I suspect that something in the multi-module history is not getting rebuilt properly.

Adding the following to a suitable view will allow you to force an OOM.

public void doClearSoftReferences( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
        rsp.setContentType("text/plain");
        PrintWriter w = new PrintWriter(rsp.getCompressedWriter(req));
        w.println("About to cause mischief");
        w.flush();
    	/* Force releasing SoftReferences
    	 * Borrowed from http://stackoverflow.com/questions/3785713/how-to-make-the-java-system-release-soft-references
    	 */
        try {
            final List<long[]> memhog = new LinkedList<long[]>();
            while(true) {
                memhog.add(new long[102400]);
            }
        }
        catch(final OutOfMemoryError e) {
            /* At this point all SoftReferences have been released - GUARANTEED. */
        }
        w.println("Mischief over");
        w.close();
    }
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to