[MLton-user] Calling into SML from C

Zachary Anderson zra at cs.berkeley.edu
Sat Apr 14 10:53:58 PDT 2007


Matthew Fluet wrote:
> What constitutes "lots and lots of memory" and "lots of time to be spent 
> in GC"?

Several hundred MB for a program that does no explicit heap allocation, 
and, like, 60% time in the GC.

> And there will almost certainly be some 
> allocation done in calling any exported ML function.  So, I would expect 
> that if you write a loop in C that does nothing but repeatedly call an 
> exported ML function, then you will see memory being allocated (and 
> subsequently GCed).  Do you have example code that demonstrates the 
> situation you are seeing?

This is probably what I'm seeing. The program is essentially a loop 
around an exported function that takes a bunch of integers and returns 
unit. Is there any way to reduce this effect?

Thanks!
Zach



More information about the MLton-user mailing list