Skip to content

Each solver's PETSc options stay in the global options database after the solver is gone: about 41 entries per rebuild #950

Open

Description

@lmoresi

Every solver writes its PETSc options under a prefix unique to it (-Solver_N_*, and -meshproj_N_* for projections), and nothing removes them when the solver is dropped. The global options database therefore grows by every dropped solver's options.

Measured on the rebuild fixture of the rotated free-slip + custom-FMG rebuild test (bugfix/rebuild-leak-948), serial: 185 entries after 4 rebuilds and 349 after 8, about 41 per rebuild.

This is kilobytes, not the megabytes of #948, whose cause was outside the library. But it grows without bound over a long run that rebuilds or creates solvers repeatedly. Every later options lookup also searches a longer list.

The rotated free-slip route already drops its own keys in a finally (rotated_bc._drop_options_under, #901). The solver classes could do the same for their prefix when a solver is destroyed or collected.

Found by the adversarial review of the rebuild-memory test (#948).

Underworld development team with AI support from Claude Code

Activity

  1. added
    bug
    fixed-in-PR
    on Nov 5, 2026
  2. added 2 commits that reference this issue on Nov 6, 2026
  3. added
    fixed-in-development
    and removed
    fixed-in-PR
    on Nov 7, 2026
  4. added a commit that references this issue on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfixed-in-development

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions