|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Simple way to get an effective memory leakI 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. 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 Show quoteHide quote "creator_bob" <robertbrich***@hotmail.com> wrote in message news:1144934399.699874.23660@i39g2000cwa.googlegroups.com... >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. > Jeff Dillon wrote:
> I don't see this as a leak at all, but rather an error in logic? How would My point is that even though memory leaks are all but impossible,> garbage collection catch this? It is assuming you needed those locations, I > would assume. > > Jeff > 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. Ah, got it.
Show quoteHide quote "creator_bob" <robertbrich***@hotmail.com> wrote in message news:1144968158.018421.305640@j33g2000cwa.googlegroups.com... > > Jeff Dillon wrote: >> 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. >
Why does Replace return Nothing???
VC6 ATL DLL interop with VB.NET Should I use XML as a database for a standalone app? Mail attachment from memory Send email best use of vb.net and multithreading Determine if a File exists Title Bar is visible "Cross-thread operation not valid" without threading!! ComboBox in Bound DataGrid (VB 2003) |
|||||||||||||||||||||||