Reduce manual garbage collection frequency

In gitlab!97490 (comment 1095424902), a user sees the runner consuming 10% CPU even though there are no builds to process:

flame-Gxj8KYT3ssD0goonhyLHmxZtzhsVAn.svg

It appears this might be due to the manual garbage collection in the loop: https://gitlab.com/gitlab-org/gitlab-runner/-/blob/b2dd0a2db062f01ed7b5c724e5416e84eef7605d/commands/multi.go#L555

It seems to me that we should consider:

  1. Dropping that manual GC.
  2. Only run GC if a build was actually processed.
Assignee Loading
Time tracking Loading