Most likely you are running into memory allocation problems. In general it is better to avoid building an array in a loop for that reason. If you know how big the array is going to be (or have an upper limit on the size) initialize an array of that size outside the loop and use Replace Array Subset (or element) inside the loop to put the data into the array. This does not change the size of the array and does not create extra copies in memory.
Use the profiler to watch your memory requirements. If the memory is growing, you need to find out where and fix it. There is a lot of information on efficient use of memory in the manuals and help files.
Consider writing the data to a file and clearing the buffer (shift register). This does not eliminate the memory leak but may prevent it from killing your program. It also protects the data in the event of a power failure or other problem with the computer.
Other things to look for include references (VISA, queues, etc.)which are created but not disposed, other programs or processes running in the background, numeric overflow (an integer counting past the maximum value for the datatype usually does not cause crashes, but it is something to check). On long term data acquisiton projects it is usually wise to disable all other programs and disconnect from networks, if possible. The virus checker or the OS checking for a software update can be very disruptive.
Writing the error cluster and other status indicators to a file from time-to-time can also be helpful in troubleshooting.
Lynn