Reduce stack size to diagnose stack overflow

The title says it all :slight_smile:

I’ve got a stack overflow exception in my code, however I’m not sure quite what is causing it and the time taken to reach it is quite long.

Hence is there a compiler flag I can enter into dune/otherwise that will reduce the stack size and hence cause the bug to show itself as early as possible?

Seems like yes: OCaml - The runtime system (ocamlrun)

l
(stack_limit) The limit (in words) of the stack size.