The attached code crashes for me after having used about 10G. That seems excessive.
laplace-dirichlet-3d.py
cc @inducer @mattwala