Increasing max server memory to deal with System.OutOfMemoryException on SQL Server
The System.OutOfMemoryException error that you are seeing means there was a problem with SQL Server Management Studio, not with the amount of memory on the server itself. One easy way to trigger this error is to simply run a SELECT query on a large table. If the table is too large then the results grid will take up too much memory and you'll see the error.

It's not clear to me why you would experience this error when importing data, but raising max server memory is not the right fix. I recommend trying BULK INSERT after setting the BATCHSIZE, KILOBYTES_PER_BATCH, or ROW_PER_BATCH arguments. That will limit the amount of data sent in a single transaction. You could also try importing the data through bcp. You don't even need SSMS open for that.