space leak

Computing Dictionary

space leak definition


A data structure which grows bigger, or lives longer, than might be expected. Such unexpected memory use can cause a program to require more garbage collections or to run out of heap. Space leaks in functional programs usually result from excessive laziness. For example, the Haskell function
sum [] = 0 sum (x:xs) = x + sum xs
when applied to a list will build a chain of closures for the additions and only when it reaches the end of the list will it perform the additions and free the storage. Another example is the function
mean l = sum l / length l
The sum function forces the entire list l to be evaluated and built in the heap. None of it can be garbage collected until the length function has consumed it.
The Free On-line Dictionary of Computing, © Denis Howe 2010 http://foldoc.org
Cite This Source
Explore Dictionary.com
Previous Definition: space law
Next Definition: space man
Words Near: space leak
More from Thesaurus.com
Synonyms and Antonyms for space leak
More from Reference.com
Search for articles containing space leak
More from Dictionary.com Translator
Dictionary.com Word FAQs

Dictionary.com presents 366 FAQs, incorporating some of the frequently asked questions from the past with newer queries.

Copyright © 2014 Dictionary.com, LLC. All rights reserved.
  • Please Login or Sign Up to use the Recent Searches feature
FAVORITES
RECENT

;