Memory overflow of the variable when writing data from the accelerometer.

I want to get the accelerometer data from my Garmin watch (I'm using Forerunner 55 now), write it to a variable, and transfer it to the iPhone (a very simple application). The program works stably for several minutes (data from the accelerometer is successfully transmitted to the iPhone), then suddenly stops working. I attach the picture that appears on the Garmin watch when this happens. Below is my code. I believe that while the accelerometer is running, the dataAccel variable is overflowing, because if you remove this variable (and do not transfer data to the iPhone), then the application on the watch will not stop running. How to solve the problem with memory overflow?

import Toybox.Lang;
import Toybox.Time;  
import Toybox.Sensor;
import Toybox.WatchUi;
import Toybox.Communications;
import Toybox.Application.Storage;   

 
class AccelAppDelegate extends WatchUi.BehaviorDelegate {
    private var dataCountInArray;
    private var mySampleRate;
    private var message = [];
    private var myPeriod;

    function initialize() {
        BehaviorDelegate.initialize();
        Storage.deleteValue("dataAccel");

        myPeriod = 1;
        mySampleRate = 25;
        dataCountInArray = mySampleRate * myPeriod;

        var options = { :period => myPeriod,
                        :sampleRate => mySampleRate,
                        :enableAccelerometer => true
        };

    	var phoneCallback = method(:phoneMessageCallback);
        Communications.registerForPhoneAppMessages(phoneCallback);
        Sensor.registerSensorDataListener(method(:onSensor), options);
    }

    function onSensor(sensorData) {
        var dataAccel = "";

        for (var i = 0; i < dataCountInArray; i++) {
            var floatX = sensorData.accelerometerData.x[i].toFloat() / 1000;
            var floatY = sensorData.accelerometerData.y[i].toFloat() / 1000;
            var floatZ = sensorData.accelerometerData.z[i].toFloat() / 1000;

            dataAccel = dataAccel + "\n"+Time.now().value() + ", " + floatX + ", " + floatY + ", " + floatZ;
        }

        Storage.setValue("dataAccel", dataAccel);
        sendMessage();
    } 

    function sendMessage() {
        var accelDataToPhone = Storage.getValue("dataAccel");

        if (accelDataToPhone != null) {
            //transfer data to phone
            var listener = new Communications.ConnectionListener();
            Communications.transmit(accelDataToPhone, null, listener);
        }
    }

    function onComplete() {
        Storage.deleteValue("dataAccel");
    }

    function onError() {

    }

    function phoneMessageCallback(_message) {
        message = _message.data;
    }

    function onSelect() {
        return true;
    }

    function onMenu() as Boolean {
        WatchUi.pushView(new Rez.Menus.MainMenu(), new AccelAppMenuDelegate(), WatchUi.SLIDE_UP);
        return true;
    }
}