Using the pca built-in func will cause out of memory.
So, calculate the dimension reduced X manualy.