As you may have noticed, on the begining of April I have some urge to write something technical about some deeply specific point of OCaml. This time I’d like to tackle that through sudoku. It appearch that Sudoku is of great importance considering the number of posts explaining how to write a solver. Following that[…]


As you may know, there is a subset of Javascript that compiles efficiently to assembly used as backend of various compilers including a C compiler like emscripten. We’d like to present you in the same spirit how never to allocate in OCaml. Before starting to write anything, we must know how to find if a[…]

Reduced Memory Allocations with ocp-memprof

In this blog post, we explain how ocp-memprof helped us identify a piece of code in Alt-Ergo that needed to be improved. Simply put, a function that merges two maps was performing a lot of unnecessary allocations, negatively impacting the garbage collector’s activity. A simple patch allowed us to prevent these allocations, and thus speed[…]

Yes, ocp-memprof (s)can(f) !

A few months ago, a memory leak in the Scanf.fscanf function of OCaml’s standard library has been reported on the OCaml mailing list. The following “minimal” example reproduces this misbehavior: Let us see how to identify the origin of the leak and fix it with our OCaml memory profiler. Installing the OCaml Memory Profiler We[…]