Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!necntc!ames!ptsfa!ihnp4!homxb!mtuxo!mtune!codas!usfvax2!pdn!ken From: ken@pdn.UUCP (Ken Auer) Newsgroups: comp.lang.smalltalk Subject: Re: Smalltalk for (embedded) real-time Message-ID: <1320@pdn.UUCP> Date: Tue, 15-Sep-87 09:49:25 EDT Article-I.D.: pdn.1320 Posted: Tue Sep 15 09:49:25 1987 Date-Received: Thu, 17-Sep-87 06:42:41 EDT References: <1881@tekig4.TEK.COM> <12100004@osiris.cso.uiuc.edu> Organization: Paradyne Corporation, Largo, Florida Lines: 49 Summary: Well, that depends... In article <12100004@osiris.cso.uiuc.edu>, goldfain@osiris.cso.uiuc.edu writes: > Very briefly, is there a general programming discipline that one can follow in > the current Smalltalk-80 that will keep you from ever seeing the garbage > collection symbol come up while your method is running ? .... That depends upon what your definition of "the current Smalltalk-80" is. Different implementors have used different techniques for garbage collection. Therefore it is possible that a technique which may minimize the garbage collection symbol from appearing in one implementation, may not do the same for another. Many implementations do constant garbage collection with generation scavenging (see earlier articles with subject "Smalltalk for (embedded) real-time") which will take care of most small garbage objects for you. If I'm not mistaken, generation scavenging does not work at all for "large" objects (where the definition of "large" may be different from implementation to implementation). As a previous article states, eventually the "major garbage collection" must take place in order to get rid of large objects, and to compact your memory due to its tendency to become extremely fragmented. I'm not familiar with every implementor's method for GC, but I don't think you can really totally avoid it. Keeping the number of large objects to a minimum can greatly ameliorate the frequency of "the garbage collection symbol" in most implementations. It is also possible to write a routine to force garbage collection when user activity seems to be low (e.g. s/he hasn't touched the mouse or hit the keyboard in x amount of time) which could be great under certain user conditions, but useless under others. > ... It seems that if > your method doesn't call anything that allocates new space you are set. What > are some of the hidden pitfalls here ? I don't know if there are any hidden pitfalls... they all seem blatantly obvious to me. :-) Personally, I don't believe you can right any useful code (except a few small special purpose applications -- perhaps math intensive stuff) in Smalltalk which doesn't create new objects which need new space. If you are programming in such a way that the previous statement is not true, you probably aren't taking advantage of the language at all. If that's not the case, I'm sure we'd love to have you for an interview. :-) -------------------------------------------------------------------------- Ken Auer Paradyne Corporation {gatech,codas,ucf-cs}!usfvax2!pdn!ken Mail stop LF-207 Phone: (813) 530-8307 P.O. Box 2826 Largo, FL 34649-9981 "The views expressed above do not necessarily reflect the views of my employer, which by no means makes them incorrect."