Atreyee Sinha
Atreyee Sinha
I did some tests by comparing the dev version vs this branch on my Ubuntu laptop, and the run times are almost compatible with a small improvement (~1%) using numba...
This could be a recipe rather than a tutorial?
Thanks @adonath !I ran in the terminal `psrecord "python memory_test.py" --log memory_issue.txt --plot plot.png` and the resulting plot is:  In this case, the process was automatically killed after 80-90...
Ok I suppose there is a bug in psrecord. Running `psrecord pid --plot plot2.png` generates a very different plot  In this case it is clear that the memory usage...
The issue seems to persist both for the options `scale` and `fit` in the `FoVBackgroundMaker`. Here is the memory usage for only 20 iterations `method=fit`  `method=scale` 
The problem is not specfic only to the `FoVBackgournd maker`. It is somehow related to the caching of geoms as @QRemy guessed during the dev call. For ex: 1. Has...
Thanks @adonath ! It is indeed the caching. Commenting out the two lines ``` self.get_coord = lru_cache()(self.get_coord) self.get_pix = lru_cache()(self.get_pix) ``` you linked to in `WcsGeom.__init__` solves the memory issue.
Can we do something for this for 2.0 ? Bare minima, we can add something in the HowTo
Note that changing this will mean adapting all our benchmarks, where we rely on this to read N observations. eg https://github.com/gammapy/gammapy-benchmarks/blob/66143e05073ed392c39cf7cbd23fc8d8055a3e5b/benchmarks/analysis_3d.py#L25
Should we postpone this again? Or do we remove support for 1.x files from 2.x? @registerrier @bkhelifi @QRemy @adonath ?