Is there memory leak in FEniCS and how to fix it?

Yes. But I don’t like NonlinearVariationalSolver. It’s syntactic sugar which grossly detracts from the details of the underlying problem. See here for an example of a custom Newton solver instead. Or the Cahn Hilliard demo.

1 Like