Linked Questions

1 vote
1 answer
2k views

I was working on some code recently. Here's the gist - class Student { private String name; private List<Performance> performances; } class Performance { private Student student; ...
Null's user avatar
  • 414
2 votes
1 answer
76 views

I have 2 classes and both of them hold a reference to the other. class A { private B b; public A(B b) { this.b = b; } } class B { private A a; public B() { a = ...
Ukubu's user avatar
  • 820
0 votes
1 answer
146 views

"Orphaned cycles" may not be exactly the correct term for what I'm trying to describe. Here is an example of what I'm trying to describe in code: public class Container { private Container ...
rybosome's user avatar
  • 5,146
9 votes
7 answers
1k views

Suppose I have a doubly linked list. I create it as such: MyList list = new MyList(); Then I add some nodes, use it and afterwards decide to throw away the old list like this: list = new MyList(); ...
captain poop's user avatar
6 votes
6 answers
1k views

Could someone explain to a C++ programmer most important differences between Java (and C# as well) references and shared_ptr (from Boost or from C++0x). I more or less aware how shared_ptr is ...
watson1180's user avatar
  • 2,055
9 votes
4 answers
2k views

I have been working on a classloader leak in our application and finally got to a point where all references to the CL were gone. In my memory profiling tool (using YourKit and jmap/jhat), I can ...
Scott's user avatar
  • 938
5 votes
1 answer
7k views

I'm a bit confused about JavaFx 8 and the listener memory leak problem. The official doc says: The ObservableValue stores a strong reference to the listener which will prevent the listener from ...
Giorgio's user avatar
  • 2,250
0 votes
5 answers
945 views

I am new to Java Garbage Collection and wondering if following codes will cause memory leak in Java. Why or why not? Thanks. class ListNode { int value; ListNode next; public ListNode(...
Leopold's user avatar
  • 76
6 votes
3 answers
315 views

I have Class A with an instance variable ImageView. Currently I use setTag() to get from the ImageView back to the instance of Class A. Could that present circular loop? I also heard of mention of ...
prostock's user avatar
  • 9,585
1 vote
2 answers
412 views

A <-> B <-> C <-> D <-> A... // A is firstNode, D is lastNode if ( length == 1 ) { firstNode = null; lastNode = null; firstNode.next =...
ShrimpCrackers's user avatar
2 votes
1 answer
156 views

I have a very fundamental question in Java. I searched for this everywhere but just could not find a solution anywhere. I am trying to read about deleting a binary tree. Before dwelling into DFS, BFS ...
BegaluruBoy's user avatar