Error following "pipe: Too many open files"

Dear Roofit experts,

I am running a macro with RooFit v3.17 that performs an ML fit over data that has been separated into 40 bins. It runs fine until eventually I read on the output

[#1] INFO:Eval -- RooAbsTestStatistic::initMPMode: starting remote server process #8
pipe: Too many open files

and soon after

RooRealMPFE::evaluate(nll_mdlPdf_HISingleMuon_HP16Feb.root_ea868e00_MPFE6) ERROR: unexpected message from server process: 1897398272

Any help on why this is happening and how to fix it? Thanks.

Hello all,

I am also seeing this problem when fitting a large number of histograms. I do this in a python loop and I delete all python variables between each step. Is there a way to ask RooFit to cleanup all threads when running in MP mode? It seems that this is done now only at a program exit.

Thanks,
Rustem