Hi,
My app is using Storage to store relatively large numbers of arrays (hundreds) representing map segments to be displayed on the screen. I have noticed a few issues and wondered if there's anything I can do to counteract my memory issues on devices with only 124KB mem. These issues are:
1) As Items are added to storage the app memory usage slowly ticks up. Even if I don't run out of storage I eventually run out of memory (see 2).
2) The items are pulled by a webrequest for a json file which is an array. These are very small (<1KB), however as storage gets filled the available memory eventually falls below around 7KB and I get an Out of Memory error. The memory is ticking along at around 115KB, but the peak memory seems to hit 124KB, I presume this is because the web request is consuming 7-8KB of memory instantaniously
Is there any strategy I can use to avoid or delay this happening? Am I correct in thinking that the webrequest uses 7-8KB of memory, or is there some way I can adjust it to reduce that footprint. Can I store items differently to prevent them from consuming so much additional memory. I presume there are are some pointers to the items in storage which are consuming app memory.
I have gone to extreme lengths to reduce the amount of memory used by the app (deleting code, replacing constants with hard-coded values, removing classes, combining methods, replacing objects with arrays,flattening arrays etc) and I don't think I can get it down any futher without making the code unmaintainable.
Is there any chance app code will be loaded into a different space in future releases of the watch firmware, or not included in the 124k limit. My app code uses 66K and I'm constantly trading off writing more code (which may be more efficient) with saving memory by deleting code.