If I have a long-lasting object A and lots of temporary objects B, C, D, etc. which contain a reference to A, will those temporary objects ever be collected as long as A is referenced by something?
class A {} // (sits in web app session)
class B {
private A a;
}
class C {
private A a;
}
Where B and C exist for the request only, but contain references to A.
They will, if there is no way to reach B and C (but they reach other objects) they will be collected as usual.