Yep, using .collectList() will load the entire file content in memory before processing, defeating your purpose of saving memory. On the other hand, using buffer() is good.
.collectList()
buffer()