Usually you wouldn’t load the entire data into the host RAM or the GPU unless you are working with tiny datasets and are willing to use device memory for the latter case.
Check the data loading tutorial 2 to see how to lazily load the samples.