I've been trying to make high resolution skymaps, with 9 arcmin pixels to match GLAST's expected 68% PSF. I've found that the public version of galprop (v50p) has an enormous memory footprint. For 2400x1200 pixel skymaps it wants 70 GB of RAM... (and this is a 2D calculation.)
I think I've tracked down the origin of its greediness. It appears that a number of large 3D and 4D arrays are being allocated in gen_{pi0_decay,bremss}_skymap() that are not being freed at the end of the routine. From a quick look, it does not appear that these arrays are used anywhere after the routine returns, so this appears to be a memory leak.
An example (gen_bremss_skymap.cc):
Code:
emiss_av. init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,galaxy.n_E_gammagrid);
emiss_HII.init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,galaxy.n_E_gammagrid); //IMOS20020429
emiss_HI .init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,galaxy.n_E_gammagrid); //AWS20041214
emiss_H2 .init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,galaxy.n_E_gammagrid); //AWS20041214
n_H_av .init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,1);
n_HI_av .init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,1); //AWS20041214
n_H2_av .init(galaxy.n_long,galaxy.n_lat,galaxy.HIR.n_zgrid,1); //AWS20041214
[snip]
emiss_av. delete_array();
emiss_HII.delete_array();//IMOS20020429
n_H_av. delete_array();
Are there any objections to adding
Code:
emiss_HI. delete_array();
emiss_H2. delete_array();
n_HI_av. delete_array();
n_H2_av. delete_array();
to the end of the routine?
Similarly for gen_pi0_decay_skymap().