Correspondence to be sent to: nicolas.monod@epfl.ch We establish a connection between Dixmier's unitarizability problem and the expected degree of random forests on a group. As a consequence, a residually finite group is nonunitarizable if its first L 2 -Betti number is nonzero or if it is finitely generated with nontrivial cost. Our criterion also applies to torsion groups constructed by Osin, thus providing the first examples of nonunitarizable groups without free subgroups.