Skip to content

[BUG] DRAGONS memory issue #61

@teald

Description

@teald

DRAGONS has been experience memory issues with certain datasets/images. This memory seems to be exploding due to something related to astrodata.

Describe the bug
Memory explodes when certain astropy models are used (e.g., Chebyshev2D).

To Reproduce
Using memory_profiler and astropy (and nothing else):

from astropy.modeling.models import Chebyshev2D
import numpy as np
from memory_profiler import profile
import gc


@profile
def main():
    x = np.linspace(0, 1, 1_000_000, dtype=np.float32)
    y = x**2 + 1

    model1 = Chebyshev2D(3, 3)

    result1 = model1(x, y)

    model2 = Chebyshev2D(4, 4)

    result2 = model2(x, y)

    model3 = Chebyshev2D(10, 10)

    result3 = model3(x, y)
    
    # Garbage collection does not help, because there are
    # references left over in the model object.

if __name__ == "__main__":
    main()

Expected behavior
Not this.

Metadata

Metadata

Labels

bugSomething isn't workingexternalBugs that are caused by external dependencies and other factors.wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions