[plt-scheme] DivaScheme and Frequent GC

From: Will M Farr (farr at MIT.EDU)
Date: Fri Aug 24 11:47:26 EDT 2007

Hello all,

First, before I say anything else: a huge "thank you" to the  
DivaScheme team.  I *love* it!  But...

Has anyone else noticed how DivaScheme seems to allocate a lot of  
memory in the course of regular operation on long files, resulting in  
frequent minor GCs?  Yesterday I was editing a scheme file about 300  
lines long, and DivaScheme was nearly unusable.  It allocated so much  
that it triggered a GC about every 10 characters typed (even fewer if  
a new line was involved---presumably because it was re-doing the  
indentation).  When DrScheme has about 300M in play, and presumably  
the first generation is pretty big, even these minor collections take  
a few seconds (maybe 5?) on my aging PowerBook G4 800 MHz.  Try  
typing, with forced multi-second pauses every 10 characters or  
newline---it's pretty frustrating.  I ended up turning off  
DivaScheme, and then editing was pretty tolerable (GC pauses  
occasionally, but maybe only ever 100 characters or so, largely  
independent of newlines).

I don't have hard data, but it's my impression that this problem is  
more apparent when editing long files.  That makes me suspect that  
it's related to the aggressive indenting that DivaScheme performs  
that is causing all the allocation, but I don't really know.

I'm not writing this to complain about DivaScheme (or to demonstrate  
how attached I am to my slow 6-year-old PowerBook---I'm sure a new  
MacBook Pro would make this much more tolerable), but rather to find  
out if there's any configuration options I can tune that will help  
with this problem.  Maybe there's a way to make it indent less often,  
or try to indent fewer lines, and thus reduce the memory  
consumption?  Maybe it's trying to update the tags table (for TAB- 
completion) and there's a way to make it do that less often?  Maybe  
there's nothing I can do for now, but the DivaScheme team is aware of  
the issue and version 1.3 will reduce memory consumption?  Maybe  
there's some simple task they could get me to do that will help them  
improve this?  Maybe other people on this list have solved this  
problem themselves and have a suggestion for me?

Once again, thanks for a great tool!

Will


Posted on the users mailing list.