I'm rewriting a clock appliction with intgrated touch launcher to a buffer-based app. I'm using a 1 bpp array buffer and the app is meanwhile getting big. When I start the app I'm using 53% of the memory (including buffer). When I retrieve the app list from the storage I'm running into memory problems. My idea was to free the buffer for the launcher part by assigning an empty array and afterwards to reallocate the buffer for clock operation. However I'm running into memory issues since it seems that the garbage collector of JS is slower than a user can interact with the watch, e.g by pressing the assigned exit list button, which then clears the list and quickly reallocates the buffer.
Is there any way to get rid of this memory problem?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm rewriting a clock appliction with intgrated touch launcher to a buffer-based app. I'm using a 1 bpp array buffer and the app is meanwhile getting big. When I start the app I'm using 53% of the memory (including buffer). When I retrieve the app list from the storage I'm running into memory problems. My idea was to free the buffer for the launcher part by assigning an empty array and afterwards to reallocate the buffer for clock operation. However I'm running into memory issues since it seems that the garbage collector of JS is slower than a user can interact with the watch, e.g by pressing the assigned exit list button, which then clears the list and quickly reallocates the buffer.
Is there any way to get rid of this memory problem?