<div dir="ltr">I am suspecting that there is a memory leak in the implementation of non-linear preconditioners in PETSc.<div><br></div><div>When I use the following options I see the memory usage increase (using the windows process monitor) during consecutive time steps.</div><div><br></div><div>  PetscOptionsSetValue(NULL, "-snes_type", "qn");  </div><div>PetscOptionsSetValue(NULL, "-snes_qn_monitor", "");<br>PetscOptionsSetValue(NULL, "-snes_qn_scale_type ", "jacobian");<br>PetscOptionsSetValue(NULL, "-npc_snes_max_it", max_it);<br>PetscOptionsSetValue(NULL, "-npc_snes_type", "newtonls");<br>PetscOptionsSetValue(NULL, "-npc_pc_factor_levels", ilu_level);<br>PetscOptionsSetValue(NULL, "-npc_ksp_rtol", s_ksp_rtol);<br>PetscOptionsSetValue(NULL, "-npc_snes_linesearch_type", "bt");<br>PetscOptionsSetValue(NULL, "-npc_snes_linesearch_max_it", "5");<br><br>SNESSetFromOptions(snes);<br></div><div><br></div><div>I destroy the context after each time step</div><div><br></div><div><br></div><div>However, if I don't use a non-linear preconditioner, ie., </div><div><br></div><div> PetscOptionsSetValue(NULL, "-snes_converged_reason", "");<br>PetscOptionsSetValue(NULL, "-snes_type", "qn");<br>PetscOptionsSetValue(NULL, "-snes_qn_monitor", "");<br>PetscOptionsSetValue(NULL, "-snes_qn_scale_type ", "jacobian");  <br></div><div>  SNESSetFromOptions(snes);  <br></div><div><br></div><div>Then everything works fine.</div><div><br></div><div>Am I missing something?</div><div><br></div><div>Thanks!</div><div>Adolfo</div><div><br></div></div>