home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / function / 1467 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.9 KB

  1. Path: sparky!uunet!mcsun!sunic!dkuug!uts!id.dth.dk!sestoft
  2. From: sestoft@id.dth.dk (Peter Sestoft (EMP))
  3. Newsgroups: comp.lang.functional
  4. Subject: Re: Q: garbage collection in Miranda
  5. Keywords: garbage collection Miranda
  6. Message-ID: <sestoft.724491169@id.dth.dk>
  7. Date: 16 Dec 92 07:32:49 GMT
  8. References: <AOT9CLP@math.fu-berlin.de>
  9. Sender: news@id.dth.dk (USENET News System)
  10. Organization: Department of Computer Science
  11. Lines: 33
  12.  
  13. doerr@inf.fu-berlin.de (Heiko Doerr) writes:
  14.  
  15. >While looking for data structures to store states of a computation
  16. >the following questions arose concerning the garbage collector of
  17. >Miranda. ...
  18.  
  19. >2) Is the garbage collector non-deterministic or can the following effect
  20. >be predicted?
  21. >Once you evaluate the expressions "#(list 50000)" and "#[0..50000]"
  22. >several times you will notice that the evaluation does not succeed all
  23. >the times. Could anybody tell me whether and if so how the garbage
  24. >collector is related to the operating system to explain this
  25. >non-deterministic behaviour.
  26.  
  27. My experience from 2 years ago suggests that it is rather
  28. nondeterministic (in the SUN 4 version, at any rate).  Maybe the
  29. garbage collector looks at the (C?) stack and conservatively assumes
  30. every word found there to be a heap pointer.  If some of those words
  31. are not heap pointers but integers, arbitrary amounts of garbage will
  32. not be collected.  Note that this is safe, but quite confusing for the
  33. functional programmer whose program uses widely varying amounts of
  34. storage.  
  35.  
  36. >These runs were executed on SUN-4 with 16 MB and Miranda version 2.014.
  37.  
  38. Try the VAX implementation.
  39.  
  40. Peter (almost merely guessing --- I can't find the relevant notes)
  41. --
  42. Peter Sestoft   *   sestoft@id.dth.dk   *   Department of Computer Science
  43. Technical University of Denmark, Building 344      DK-2800 Lyngby, Denmark
  44. Tel: +45 45 93 33 32 * Direct: +45 45 93 12 22/3749 * Fax: +45 42 88 45 30
  45.