if you do something like this you never free the big array as you have reference to it via the striding

ok?

you should do:

data = data[:, :self.n_components].copy()