Avoid eager Jenkins items lookup in the webhook cleaner. by duemir · Pull Request #267 · jenkinsci/github-plugin
Use lazy iterable of all items instead of using an eager list of all the items that is stored in a local variable but immediately converted to the iterable.
I was looking through the heap dump in Eclipse MAT. Most of the memory was just taken by the WorkflowRun objects. It caught my attention that the Cleaner thread featured prominently in the Leak report. I looked into it and thought it could be improved a bit. Functionally nothing should change, the thread just no longer directly references all the items for the duration of execution.
I have also taken a chance to refactor the anonymous classes into lambdas in the functional utility class JobInfoHelpers.
- Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- Ensure that the pull request title represents the desired changelog entry
- Please describe what you did
- Link to relevant issues in GitHub or Jira
- Link to relevant pull requests, esp. upstream and downstream changes
- Ensure you have provided tests - that demonstrates feature works or fixes the issue