Understanding garbage collection in Java for objects managed by container
问题 Lets say I have a managed bean called A that is @RequestScoped Let's say A has a reference to another managed bean B and B is declared to be @SessionScoped . Will the fact that A has a reference to another bean with longer scope prevent A from getting garbage collected at the end of the HttpRequest ? Will the situation change the other way around ie if B contains a reference to A ? if yes then why ? 回答1: Will the fact that A has a reference to another bean with longer scope prevent A from