I don't recommend that you do any explicit System.gc() calls. They will be done when needed anyway, and doing explicit System.gc() calls just empties caches that will slow down performance in general. If you declare an object within init.bsh, then it shouldn't persist on your next album build, but nulling some references when you know that you no longer have need for them is not a bad practice. I do the same with many references internally in the AlbumBean after a completed album build.
OK, I will just nullify the objects that are no longer needed.
However, as I said, an object from the previous generation was reused. There is a method that verifies that the array does not contain duplicates. After the first make, it reported no errors. I made it again and it reported that every entry was duplicated. I made again and it reported that every entry was duplicated twice. Each time, I made the album as soon as the previous make finished.
I was surprised to see this behaviour. Anyway, it seems that nullifying the object fixes it, so I won't investigate any further.
, you're using a static array, but shouldn't. "static" variables should be used very rarely as they have a very long lifetime. They survive album builds. They usually live throughout the runtime session. When you declare a variable as "static" it's not stored along with instances of that class, so nulling instances for garbage collection doesn't affect static variables. They are instead stored in the static section of RAM memory where class code is stored and there is only one instance of these variables per class.