This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||
|
These edits are not discussing a memory leak, but rather an application writing outside of allocated memory. This is not the same thing as a memory leak, which is the topic of this article. I intend to revert these changes, but wanted to discuss it first. – Doug Bell talk•contrib 08:52, 27 January 2006 (UTC)
I don't believe that it is servers that cause memory leak problems, but rather background tasks that run for long periods of time. Typically they will run on servers, but they can just as easily be running on a workstation. wrp103 (Bill Pringle) 03:16, 4 June 2006 (UTC)
er, first time attempt at an edit, so (i know this won't work) be nice. excellently written article, it seems to me (simple for a non IT person to understand), but this: "Most modern operating systems on general purpose computers use a hard disk to provide virtual memory. The effect once RAM has run out is increasing use of hard disk. The hard disk can in turn eventually run out, but usually the performance of the application and/or system will have become so slow that they will be considered to have failed before that point.
If a system crashes simply because an application has continually asked for more memory, this would be considered poor system design or a bug." seems like a tautology. —The preceding unsigned comment was added by 66.117.148.50 (talk • contribs) .
An application that continues to allocate memory without giving some up is poorly designed. It is very convenient to implement, and might be appropriate for programs which know the aggregate allocation is acceptably small.
I don't think it's quite a tautology: the distinction is that the platform itself might be blamed for poor performance ("Maybe the disk needs defragging", or "Maybe time for a CPU upgrade") and not the offending application. —EncMstr 23:20, 9 August 2006 (UTC)
Failure to release memory isn't in itself a memory leak. The memory is perhaps wasted and it may be an inefficient use, but the memory can still be accessed and released by the program. Perhaps we can add a condition to the first paragraph that says not only memory that is not released, but through programming errors "cannot be released" which is a more accurate description of a memory leak, as opposed to poor memory management. Arthurrh 00:43, 31 October 2006 (UTC)
I'm having trouble understanding the distinction. Do you mean a substandard implementation of a heap manager? Memory which is mismanaged or wasted is still memory not to be acquired in the usual way. Correcting the problem still requires engineering effort, whether that's upgrading one component or the other, who cares? — EncMstr 00:53, 31 October 2006 (UTC)
"Memory leaks are often thought of as failures to release unused memory by a computer program. Strictly speaking, that behaviour is just more memory consumption. A memory leak occurs when the program loses even the ability to free the memory." http://dictionary.laborlawtalk.com/Memory_leak is one source for it. There are many places on the web that define it more broadly, as this paragraph mentions, but they are incorrect.[citation needed]
Arthurrh 20:28, 31 October 2006 (UTC)
Also look at: "Final note: Some people have strong opinions about this. "Whenever memory is allocated but not returned to the system, this is a leak per definition." That's like defining a leak as " whenever water from the sea enters the ship". Would you really accept an prohibition of showering, just because of some overzealous toolmakers?" from http://butunclebob.com/ArticleS.JamesGrenning.CppTestToolsMemoryLeakDetector Arthurrh 20:35, 31 October 2006 (UTC)
Further discussion at: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/160774 Arthurrh 20:38, 31 October 2006 (UTC)
Can memory leakage be caused by faulty hardware?--ChrisJMoor 09:38, 28 March 2007 (UTC)
That so? What about execution errors in a process that changes its memory usage that are caused by the hardware itself? Probably clutching at straws here but its worth asking. I suppose what I am asking is whether memory leakage is a possible outcome of a 'hard' computer error here.--ChrisJMoor 20:51, 31 March 2007 (UTC)
I reverted a comment which added "(Please note items like embedded devices do not suffer this problem as they usually run dedicated programs from flash/rom) and as such usually very stable in memory usage)" because
I added the vbscript example of a reference-oounting memory leak. The syntax highlighting engine apparently doesn't recognise vbscript, so I tagged it as vb. In this case, the vbscript is perfectly legal VB, but maybe the syntax highlighter needs updating. Dominic Cronin 22:15, 11 October 2007 (UTC)
Bill Pringle has alerted me to the need for citations in my recent contribution. Here is my response.
In general, I think what I added is fairly uncontroversial, and there are probably millions of programmers in the world who are directly familiar with the kind of leaks I have described. My description comes as much from working actively as a programmer for the last twenty years as from any specific citeable source. I wrote the code example myself to illustrate the point.
It's definitely not controversial to state that reference counting "garbage collection" systems don't cope well with cyclic references. With some fairly minor additions, the example code could be expanded to a working experimental demonstration of a cyclic reference memory leak. It might be more controversial to suggest that mark and sweep systems are more costly, as perhaps that's implementation-specific. (I hope it's clear that I'm using the term "costly" in the sense of "requiring more resources or processing effort"). In practice, mark and sweep systems tend to be quite efficient when they aren't collecting as they don't actually need to do anything. This gain is offset, though, by fairly heavy use of resources when a GC actually takes place.
If anyone is an authority on Javascript, Douglas Crockford is. Perhaps a link to his page (http://javascript.crockford.com/memory/leak.html) would be useful in the context of my note about AJAX programming techniques in browsers.
As for AJAX techniques keeping a given DOM alive for longer than traditional web pages, well that's basically what AJAX is: you keep a single page loaded, and then update it in the browser using callbacks to the server. So I don't think that's a controversial statement either. Perhaps a link to AJAX (Programming) would be sufficient.
So in summary, I accept that there's room for improvement in this piece, but I'm not sure quite how that should be done. Where the nature of the contribution is uncontroversial, I think we can rely as much on the wiki process as on citations. I don't notice anyone rushing to add citations in support of the battle of Hastings taking place in 1066.
Dominic Cronin 23:08, 23 October 2007 (UTC)
I think memory leak problem is not relevant to Garbage Collected environments like Java, C# etc. Because as long as you have a reference to memory you can use it and free it up.... It's however a brain leak of a programmer himself!!!
The statement "Whereas the C model requires the programmer to allocate and release resources explicitly" is overly broad and simply not true. The examples are slanted and poorly chosen: the C example using calloc
could just as well have been written using for example an automatic int array (i.e. int array[1024];
) or alloca
, both of which would follow the RAII principle exactly like the C++ one. Likewise, the C++ example could just as easily have been written using the new
operator, which would not follow the RAII principle. 89.181.3.50 (talk) 06:27, 13 March 2008 (UTC)
Either the line at the end of the first paragraph of the Programming Issues needs removing or to be made to look less like it was tacked on the end by one of its developers. I'm not in a position to decide whether it is as worthy of mention as the other, provided, examples. The [Page] lists the last update as December 07. Lordandmaker (talk) 15:56, 27 November 2008 (UTC)
This article can be found by a redirect of Space leak. However, in the entire article, the term space leak does not occur. Is space leak a synonym for memory leak? If so, shouldn't it be mentioned in the introduction. If not, why does space leak redirect to here? Erwin (talk) 09:30, 3 January 2014 (UTC)
After three years of inactivity, I have added a sentence about the difference between memory leaks and space leaks. Erwin (talk) 23:43, 26 May 2017 (UTC)
The image with the "sawtooth" pattern is in this context wrong and not a candidate for memory leak. A memory leak is visible when the basic value always rises. Here I am missing a reference to this statement. — Preceding unsigned comment added by 193.108.8.100 (talk) 12:17, 20 August 2019 (UTC)