From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!npeer.kpnqwest.net!EU.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Destructors References: <3d10bf56$1_1@nntp2.nac.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3234315948769890@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 32 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 29 Jun 2002 05:05:48 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1025327148 193.71.199.50 (Sat, 29 Jun 2002 07:05:48 MET DST) NNTP-Posting-Date: Sat, 29 Jun 2002 07:05:48 MET DST Xref: archiver1.google.com comp.lang.lisp:35899 * Kaz Kylheku | You may run out of descriptors if you generate too many open file descriptors | before the next garbage collection happens (GC probably won't be triggered on | the condition of running out of descriptors!) This is actually an important point. I had an application once that I tuned down to cons very little memory, but which opened and closed a lot of streams. In Allegro CL at the time, streams allocated buffers from a pool of memory that was not garbage collected the same way other Lisp memory was (called the C heap -- I think the reason was that the buffers should stay put and not move around with their stop-and-copy garbage collector). This memory could also not be released the same way a huge Lisp heap could be released once it had all turned into garbage. My application had been running for about three months when I noticed that it had consumed lots of swap space. It had showed no signs of slowing down, either, bu the dataset was now some 280M of C heap and 120M or so with Lisp heap. By decreasing the garbage collection frequency, I had accidentally let the C heap grow *huge* before the Lisp heap triggered a garbage collection and almost all of it was freed. The Lisp heap was fairly stable -- most of the objects created during a day's run would remain in memory until the midnight cleanup -- so I had effectively turned off garbage collection during the day. Tuning the garbage collection so it happened about every half hour during the working hours led to a 16M C heap and 70M Lisp heap -- because the objects were now in old space instead of the duplicated new space. It was an important lesson in the mechanics of garbage collection, which turned out to be useful when I decided to live the same place for more than two years -- annual copying garbage collection had worked just fine during my university years. -- Guide to non-spammers: If you want to send me a business proposal, please be specific and do not put "business proposal" in the Subject header. If it is urgent, do not use the word "urgent". If you need an immediate answer, give me a reason, do not shout "for your immediate attention". Thank you.