On Fri, Dec 29, 2000 at 08:05:10PM -0800, Ian Clarke wrote:
> On Fri, Dec 29, 2000 at 08:58:54PM -0500, Travis Bemann wrote:
> > With GC you should reuse datastructures whenever possible.
>
> Travis, it sounds like you have knowledge in this area, do you have any
> interest in trying to address the inefficiencies? I agree that it is
> amazing that a node would require over 70MB to operate, there is clearly
> at least one bug somewhere. We really need someone who knows about
> these things to do some profiling and address it.
I just know some of the basic rules on how to use memory efficiently
in a GC environment. One possible memory leak is the
protected/private memory leak, which is a major problem in Java that
is somewhat equivalent to the classical memory leak in languages such
as C and C++. What this memory leak is where a reference to an object
is passed to another object through a function call. The other object
stores the reference in a protected or private variable, list, array,
etc. so that when the main program loses the reference to the object a
non-circular reference to the object still exists. The main way to
solve this problem is to properly use remove/unregister/delete
functions to do stuff like properly remove references to things such
as listeners from objects.
The problem with GC is that it has a tendency to make programmers
forget that memory management is important. Even with GC, you still
have to worry about memory leaks and memory usage. With languages
such as C and C++, you *must* pay attention to these things, while GC
often allows programmers to forget about these things because GC
handles a lot of this stuff behind the scenes.
--
Travis Bemann
Sendmail is still screwed up on my box.
My email address is really [EMAIL PROTECTED]
PGP signature