Skip to content

Adding a propagation layer leaks ~183 kB per FireDomain #159

Description

@HugoFara

Fix in #182.

Each FireDomain with a propagation layer leaks ~183 kB (construct, addPropagativeLayer("Rothermel"), delete). It grows linearly: +367 MB after 2000 domains. Without the layer the loop stays flat. Measured on dev @ f00d722.

Causes found (they may not explain all 183 kB):

  • ~FireDomain never deletes propagativeLayer (the delete is commented out, FireDomain.cpp:335).
  • The PropagationModel goes into the static propModelsTable and nothing ever removes it.

Fix after #157. While the double-delete is there, freeing the models turns this leak into a crash.

Related: getFreePropModelIndex() (FireDomain.cpp:857) underflows a size_t when the table is full, and getFreeFluxModelIndex can return a slot that is already in use. Neither is reachable today, but a fix here can make them reachable.

This matters for ensembles and long-running Python hosts.


Drafted with Claude Opus 5, reviewed by a maintainer.

Activity

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions