Sd read

Does arduino sd card read function read until all the ram is used up ? Or do you have to control that in your program?

There is no memory manager, so the microcontroller doesn't know when it runs out of RAM.

In the case of the read method (Arduino - FileRead) you must provide it both the buffer to store the data in and the amount of data to read.

Syntax
file.read() file.read(buf, len)

Parameters
file: an instance of the File class (returned by SD.open())
buf: an array of characters or bytes
len: the number of elements in buf