Simple way to get an effective memory leak

C

creator_bob

I decided to post here after a little incident where I got an effective
memory leak that was immune from garbage collection.

I created a simple binary tree, no balancing or deleting. Only two
functions from the root--update (add if missing), and read. The
problem was the update had a bug and after updating, it would always
then add as though the item were missing. This caused the tree to grow
unbounded, but from all outward appearances, the program ran normal.

Just pointing out that it is very easy to get an effective memory leak
even with garbage collection.
 
J

Jeff Dillon

I don't see this as a leak at all, but rather an error in logic? How would
garbage collection catch this? It is assuming you needed those locations, I
would assume.

Jeff
 
C

creator_bob

Jeff said:
I don't see this as a leak at all, but rather an error in logic? How would
garbage collection catch this? It is assuming you needed those locations, I
would assume.

Jeff
My point is that even though memory leaks are all but impossible,
faulty logic can still have the same effect as a leak and still not be
detected. I'm new here; this has probably been discussed many times.
Note the word "effective". I didn't say it was a leak. My point is
that programmers must still be vigilant and not think that things like
this can't happen to them; there are ways to use up memory even with a
garbage collector.
 
J

Jeff Dillon

Ah, got it.

creator_bob said:
My point is that even though memory leaks are all but impossible,
faulty logic can still have the same effect as a leak and still not be
detected. I'm new here; this has probably been discussed many times.
Note the word "effective". I didn't say it was a leak. My point is
that programmers must still be vigilant and not think that things like
this can't happen to them; there are ways to use up memory even with a
garbage collector.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top