I'm glad that the compiler problem is now explained, but I don't think that it explains the situation with your application. The problem would only effect programs that use a saved world (which the compiler does, but unless you explicitly call MLton.World.saveThread yours won't) and only when you save the heap on a machine with a different amount of RAM from when you re- load the heap.