[yt-users] potential memory leak when using snapshot

Wolfgang Kastaun physik at fangwolg.de
Mon Jun 22 04:24:40 PDT 2015


Hi,

I've been trying to make a movie from volume renderings with Yt. The
data is available as uniform numpy arrays, which are loaded using non-Yt
infrastructure. For each movie frame, the following is done:

Create Yt data from 3D numpy array rho
dct = {"density":rho}
ytdat = yt.load_uniform_grid(dct, sh, bbox=bbox)

Create camera
cam     = ytdat.camera(c, L, W, N, self.transf, fields['density'],
                north_vector=[0,0,1], steady_north=True,
                sub_samples=5, log_fields=[True])


cam.transfer_function.map_to_colormap(self.lgmin,self.lgmax,
                                      scale=15.0, colormap='algae')


Save movie frame as png:
cam.snapshot(fn=name)


Even with medium sized datasets (60^3), this runs out of memory after 30
frames or so. Some observations:

Doing the same thing, but without the cam.snapshot(fn=name), the memory
leak is gone.


Creating the camera just once from the first dataset, and use
cam.snapshot every frame does *not* increase memory usage. Of course, it
then renders the same data over and over.


Maybe I am doing something wrong. For example, is there a way to just
replace the dataset for an existing camera?

Any hints ?


Best Regards,
Wolfgang Kastaun.




More information about the yt-users mailing list