[gambit-list] Help With Memory

Marc Feeley feeley at iro.umontreal.ca
Mon Sep 22 15:43:22 EDT 2008


I'm not sure this is your specific problem, but it might lead you to a  
solution.  My suggestion is...

    avoid using with-exception-**handler** unless you know what you  
are doing

Instead use with-exception-**catcher** .  When you use with-exception- 
handler, you can get into infinite loops (which gobble the memory in  
your heap) when your exception handler raises an exception, and this  
seems to be the case here.

Marc


On 22-Sep-08, at 12:26 PM, Joel J. Adamson wrote:

> (define (mem-handler exc)
>  (if (or (heap-overflow-exception? exc)
> 	  (stack-overflow-exception? exc))
>      (if (noncontinuable-exception? exc)
> 	  (abort exc)
> 	   exc)
>      (with-exception-catcher error-handler
> 			      (lambda ()
> 				(raise exc)))))
>
> And then run the main driving routine within this like so:
>
> (with-exception-handler mem-handler
> 			(lambda ()
> 			  (gen-sim-data)))




More information about the Gambit-list mailing list