This question relates to Scala objects, which are defined something like this:
object Pipeline {
val dispatcher = new Dispatcher
}
I know that in some cases they are called โcompanionโ objects, although I still do not understand the difference. Anyway, I want to know when they collect garbage. So, in the above example, I would like to know when the memory occupied dispatcherwill be restored, if ever.
source
share