Suppose I have a positive semidefinite matrix $M = \sum_i^N A_i^T A_i$ where each $A_i$ is a fat matrix of shape (m,n) and $m << n$, we can also assume that $A_i$ is full rank(but the stacked matrix might not be). I can compute the projection onto the kernel of $M$ by computing the individual projections onto the kernel of $M$, given by $P_M = I - M^T(M M^T)^{-1} M$.
How can I improve this algorithm by exploiting the fact that the $m \times m$ system is easy to work with while keeping the memory cost low? Specifically, I would like a more stable and possibly more memory-efficient algorithm for this. Also, I only care about projection vector products, not the projection matrix itself which I can't store in memory.