From: Richard M K. <kr...@pr...> - 2008-09-12 18:50:19
|
Robert Uhl writes: > Does anyone have some suggestions for dealing with and optimising SBCL's > memory utilisation? I'm working on a science-fiction game which > generates solar systems and I've been running out of heap space. What's > strange is that I can generate 10,000 systems in one profiling run but > the _second_ run crashes. I've looked and looked and none of those > systems should still be referenced anywhere in memory; the loop looks > like this: > > (unwind-protect > (progn (sb-profile:reset) > (sb-profile:profile "TRAVELLER") > (dotimes (i 10000) (generate-system)) > (sb-profile:report)) > (sb-profile:unprofile)) > > I've looked at all of my code, and none of it is storing any of the > systems in any globals; moreover, from the code above one can see that * > and friends shouldn't be referencing and of the first run's data. > Neither should the previous profiling run's data be referenced, since I > call SB-PROFILE:RESET. And yet, fairly reliably, I exhaust the heap and > SBCL drops down to LDB. > > Just for laughs & giggles, I've thrown in an SB-EXT:GC after the > GENERATE-SYSTEM--same result. What happens if you use (sb-ext:gc :full t)? -- RmK |