I an Currently working on a javaEE project that uses weld Cdi implementations.i wasvassign a task to analyse memory leaks and memory management in our appplication. I am Confuse on following aspect about garbage collector and cdi proxy object. i have Cdi Session scoped LoginController bean. when tow or more than two user login than on doubt respective number of LoginController bean get created.If This Login Controller bean is inject to somer other bean and when that other bean is accessed that a proxy to Login Controller is created and trhe request is processed.No matter how many LoginController is created only single instance of Proxy object of LoginController is Created.
Since LoginController bean get garbage collected when the session timeout.But Proxy to Login Controller is never garbage collected once it is created even id all Login Controller beans get garbage collected . i want to know Why..?