Thanks for the quick reply. I have 2K RAM and this should be sufficient to store the two buffers.
I now actually have managed to solve the lock-up!! I realised that the computer did not try to send any data when uplaoding since I didn't see the RX LED on the board. For some reason, the wrong board type had been selected. When I corrected this, I could upload a new skectch. I will now try to see why the sketch does not work properly. The first thing will be to reduce the BUFFER_SIZE.