It won't change anything if you set variable "session" to null because it's visibility scope is limited by for operator. And if you look at screenshot you will see that garbage collecter can't free session memory because KnoledgeBase is referencing those sessions, not Main method.