Java and Large Applications



I'll probably get flamed, but...

I just spent the morning fixing my umpteenth "memory leak" in a large
Java application (~200,000 lines) that I have been writing for several
years. Again, it turns out to be "hidden" pointers inside Swing that
hold on to DefaultMutableTreeNodes even though I explicitly set the
tree root to null (the hidden pointer has to do with TreePath). This
prevents the 200,000 tree nodes from being garbage collected until the
tree itself is freed.

When I first started learning C++ about 20 years ago, I had an implicit
distrust in a language with so many "side-effects" in the underlying
library that I could never know about.

I considered (toyed with) the idea of rewriting my Java app in C. Of
course, it would probably be 1,000,000 lines long, but at least I could
control every memory allocation and deallocation.

So much for garbage collection.

Any thoughts?

.



Relevant Pages

  • Re: Java and Large Applications
    ... > I just spent the morning fixing my umpteenth "memory leak" in a large ... > tree root to null. ... > I considered the idea of rewriting my Java app in C. ... it clearly states that setting pointers to null to ...
    (comp.lang.java.programmer)
  • Re: Get reference to object in Set
    ... Java is that a Java char is 16 bits wide. ... Strings memoizing their hashes. ... patricia tree than using a HashMap or similar structure. ...
    (comp.lang.java.programmer)
  • Re: How memory leaks in java
    ... >:Strictly speaking, you can't have a memory leak in Java, at least not ... I rather suspect that simple "circular" references, ... one of the strengths of Java). ... main startup method displayed that JWindow, ...
    (comp.lang.java.programmer)
  • Re: database
    ... and Java. ... Binary trees have an elegant recursive pointer structure, ... Binary Tree Structure -- a quick introduction to binary ...
    (comp.lang.c)
  • Re: How do I use Comparators?
    ... I am writing a red-black tree class. ... > I will just say I am taking this course, learning Java as I go. ... > methods work. ... IBM Australia - Tivoli Security Software ...
    (comp.lang.java.help)