GeoscienceAustralia / GeoscienceAustralia/fc

Memory leak

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13
Forks
6
Avg merge
5d 5h
Merged PRs (30d)
3

Description

I believe I've pinned down a memory leak that happens whenever fractional_cover._compute fractions is called iteratively within a process, either due to processing several input scenes, or using the dask processing. I believe the culprit is this pattern in fc/unmix/unmiximage_wrapper.c:

https://github.com/GeoscienceAustralia/fc/blob/f2a7481ae6cdf15ddea6aac93918830f9c55033e/fc/unmix/unmiximage_wrapper.c#L102-L104

It appears this operation does not free the memory held by the "original" fractionsImage_obj before pointing to a new object.

I will submit a PR for this momentarily. Happy to provide more evidence if needed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in fc/unmix/unmiximage_wrapper.c at lines 102-104 and trace how fractional_cover._compute_fractions repeatedly replaces fractionsImage_obj. Reproduce repeated processing, including dask if available, and verify memory is released between calls; the issue author indicates a PR may already be underway.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.