And The Answer Is

You could go and look at the memory.

Surely, you jest. :laughing:

In any event, magnetic core was slightly before my time.

Iā€™m old, but not ancient.

Youā€™d need a very big magnifying glass

Without getting too technical, what is a memory leak?

Itā€™s when the code is mis-written so that it never gives allocated memory back to the memory pool when it is no longer in use. Eventually, the process runs out of available memory.

Thanks. You answered my second question I was going to ask. Is it cumulative? Yes.

They can be a bugger to find.

2 Likes

Nope. This was 2007, on a ā€œmodernā€ Unix operating system (MacOS).

  1. A user complained that a website this machine was running was misbehaving.
  2. Looking at the httpd logs, the problem seemed to be in a certain CGI script.
  3. I opened the CGI script in a text editor to see what the problem was
  4. By some miracle, it was mapped to the bad location in memory.
  5. I added an inconsequential debugging message at one place in the file, and saved the file.
  6. All hell broke loose, as Perl complained about errors in the file.
  7. I looked at the file again, and found that some code that Iā€™d never edited had changed.

The rest of the story, Iā€™ve already told you.

Correct.

From the userā€™s point of view, the program in question gradually uses more and more memory ā€¦ until itā€™s either restarted or it gobbles up all of the available memory (and bad things happen).

Your solution, of frequently rebooting the machine, is a good workaround when thereā€™s a memory leak.

Indeed! :laughing:

Iā€™m tempted to ignore this thread until 42 is reachedā€¦

3 Likes

I wondered whether modern languages had tools to preclude or detect memory leaks, and they do. Automatic garbage collection is not, however, a panacea.

C++ also addresses the problem by releasing the memory allocated to variables, when that variable goes ā€˜out of scopeā€™

C# tried to go further and do automatic garbage collection on allocated memory, with various degrees of success.

At least, thatā€™s my memory.