Circular Reference Sample
1. Click "Create" button.
Take heap snapshot and confirm two Leaker
objects exist.
2. Click "Leak" button.
Take heap snapshot and confirm two Leaker
objects exist, although null is set into "leaker".
- Leaker(leaker 1) -> new Leaker('leaker 1', null, registry). this is registered to registry.
-
- registry: Registry -> this contains leaker1 and leaker2 as subscriber.
- child: Leaker(leaker 2) -> createChildren() of leaker1.constructor(). leaker1 does not have parent. this is registered to registry.
-
- registry: Registry -> this contains leaker1 and leaker2 as subscriber.
3. Click "Dispose" button
To clear cycles reference before clicking "Leak" button