and library function(to be used then in scripted pipelines)
```groovy
// setCustomAction
@NonCPS
void call(String data) {
currentBuild.rawBuild.addAction(new CustomAction(data))
}
```
This allows me to expose some specific data which I can read then via build api.
But
unfortunately CustomAction instances added to builds with this function
leads to memory leak and Jenkins crash at the end. I found thousands of
those objects in heapdump, they are never cleaned
by GC.
Is this a valid(enough) way to use Action?
Is there some obvious reason(for more skilled Jenkins developers) why this implementation is bad?
Any idea why those instances are stuck in memory after builds complete and actions provided by plugins
are not?