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 ...
  • 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. ...
  • Re: database
    ... and Java. ... Binary trees have an elegant recursive pointer structure, ... Binary Tree Structure -- a quick introduction to binary ...
  • 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, ...
  • Re: How to develop without an IDE?
    ... Interestingly GNU make's large built in rule database does not contain anything related to compiling Java. ... other files that I want to 'update' in my tree. ... Here is a link showing Makefile for Java from the best book ... independent of what the IDE has. ...