Flash use will not cause a crash in a reset loop. If you are that close to running out of RAM, you will likely have a problem if you log data and run gprs at the same time. A pin change interrupt in SoftwareSerial can cause a stack overflow while an SdFat function like remove() is executing.
I am not using SoftwareSerial, I am using the internal Serial object to communicate with the gprs. The worst operation done in my application is one call of sprintf() over 69 chars array. I will check my ram usage with the function you provided, but I am sure there's not much left..
I looked at your SD module and these often fail.
The problem is that these modules don't use proper level shifters on MOSI, SCK, and CS. These signals should be converted from 5V to 3.3V with an IC based level shifter. Most SD cards are not designed to accept 5V signals.
Thanks for the feedback, I will keep in mind replacing this.
By the way all I had time today to test was to enable writing while gprs is running again and test the application and the device with gprs module wired up away from the device, not stacked on top. The results are pretty optimistic for now, the device has been working for like 5 hours now with no fails! If it continues to work normally like that for 24 hours I will uncomment the deletion of files (to restore the original application) and test it again. If the second test is also positive, then the problem is 100% eletromagnetic interference.
Thanks for the attention last few days, you've really done an amazing job with this library and its very honorable that you support people with its usage!
Will feed back soon