On Sat, Dec 30, 2000 at 12:52:38AM -0500, Scott Gregory Miller wrote:
> 
> 
> On Fri, 29 Dec 2000, Travis Bemann wrote:
> 
> > On Fri, Dec 29, 2000 at 11:01:47AM -0500, Scott Gregory Miller wrote:
> > > 
> > > 
> > > On Fri, 29 Dec 2000, Ian Clarke wrote:
> > > 
> > > > On Thu, Dec 28, 2000 at 10:52:40PM -0500, Travis Bemann wrote:
> > > > > This kind of stuff really makes me wonder about the state of
> > > > > programming these days.  It seems as if programmers have forgotten
> > > > > that computers have limited amounts of RAM and swap space and that
> > > > > processors are not infinitely fast.
> > > > 
> > > > Well, Java is not known for its efficiency, although this suggests that
> > > > garbage collection is not happening as it should.
> > > > 
> > > > What we really need are some people with profiling experience in java to take
> > > > a close look at Freenet (starting with FProxy) and see what needs improving.
> > > Well, you start out with the question "what datastructures is FProxy
> > > using?" and go from there.  I really doubt GC is at fault.
> > 
> > With GC you should reuse datastructures whenever possible.  The reason
> > why is if you don't reuse your datastructures, redundant
> > datastructures that could have been reused build up in memory until
> > the VM invokes GC.  This means that the amount of memory a program
> > uses can easily fill up available space between GCs.  This can be
> > quite significant if non-incremental GC is used and GC is infrequent.
> 
> Sorry, but thats not how GC works.  It doesnt fill up the memory and only
> run when you run out.  I'm nearly 100% positive all the Java GC's run
> pretty frequently, and most of them are incremental.  Any climb in the
> memory usage of a Java program beyond say 4 mb is a datastructure filling
> up, not a failure to garbage-collect.

Incremental GC is a Good Thing.  It prevents memory filling up with
dead datastructures between GCs (because there is no between GCs - but
on the other hand incremental GC IIRC doesn't fully GC every time it
is used).  GC being very frequent is also a Good Thing.  However, if
frequent GCs are non-incremental, then you get performance problems
(performance has always been a major problem with languages that use
GC).

As for the amount of memory used by dead datastructures between GCs,
this depends on how frequent GCs are (or if GCs are incremental), and
how many datastructures of what size are disposed of per unit time.
If there is very frequent disposal of datastructures of considerable
size, then this is a major factor.  On the other hand, if there are
few datastructures of little size disposed per unit time, then this is
not very significant.

As I said in my post in this thread in response to Ian Clarke, there
could be protected/private memory leaks.  This is essentially where
references to objects are passed to other objects and are stored in
protected/private members.  If these references are not properly
removed using a remove function or method, then these objects will
remain in existance long after the main program has forgotten about
them.

-- 
Travis Bemann
Sendmail is still screwed up on my box.
My email address is really [EMAIL PROTECTED]

PGP signature

Reply via email to