Knowing that write/read hard drive (SD card, etc.) cost more then write/read Memory (RAM) I would suggest you keep track off the memory available while collecting the GPS data and define a threshold to write the data to hard drive. I cannot tell you what is the optimum threshold. You can keep track of the memory like that:
long totalMemory = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
if(threshold > freeMemory)
//1-write to hard drive
//2-make sure you use the proper mechanism to help the
//garbage collector (GC) do its job. ex: reinitialize your data structures, set them to null ...
Note that the GC might take time before clearing the memory, you would also need to handle that properly because after you clear your data structures your free memory wont become bigger right away it could get to zero before but hopefully the GC will do the job and you won't go out of memory. Don't need to remind you that you have to handle the out of memory scenario! Have a nice day.