Have you tried running in parallel? I think UMFPACK is the default solver when running in serial which has some restrictions as you've noticed here with memory.
Try for example using a direct solver:
f = project(Constant(1.0),V, solver_type="mumps")
f = project(Constant(1.0),V, solver_type="superlu")
or a Krylov subspace solver
f = project(Constant(1.0),V, solver_type="cg", preconditioner_type="amg")