-
yeah that's what i thought. if i declare a global "street" variable, set it in the menu handler and use setInterval in the main to detect for the variable being set then it effectively frees the menu's memory. however i expected it to be also true if using a setTimeout in the handler itself since i thought the timeout's function would not be associated with the menu (the menu's handler registers the timeout and completes) and this is not the case.
so i have the setInterval workaround which is fine, i'm not stuck but somehow it still don't get why the garbage collector is not freeing the memory if i use a timeout.
-
hi,
i'm getting tight with my memory usage so I started profiling it a little bit.
i'm actually starting my app with a few menus and these guys require quite a lot of memory allocations: i need to decompress a few arrays using heatshrink.
now, after i select my entry in the menu i can safely free all this memory and live happily ever after.
i just need to keep a very tiny array i created in the callback.however i'm not sure how to do that. i don't see how to wait in the main function for the menu to return so i usually launch my code in the menu entry's callback itself. if i do that however, all large arrays stay allocated. i tried to use a timeout to create a new task and return from the menu callback which works but does not free my memory.
i'm actually not even sure how the garbage collector is working.
i'm not sure i'm clear. my code is here : https://github.com/wagnerf42/gps/blob/main/app.js
i want to call the function on line 357 with the local street array and free the memory decompressed line 321. -
i extracted my city's ways from openstreetmap. with some clever encoding (btw i laughed at Uint24Array but it's just what i needed) i'm actually below 200k. i'm amazed it's fast enough to display on the watch with little optimisations (1.5 secs to display). i still need to add the street names and port the low mem path algorithm to javascript and we might have a full gps. i'm not still 100% sure the path algorithm will fit the ram though, it's kind of a challenge. well, all the stuff i like.
-
-
-
-
-
hi,
i'm trying to read a large file (200kb).
(i just tested on the emulator and not the watch.)using : let a = require("Storage").readArrayBuffer("test.map");
it loads but a.length is equal to 22053.if i try let a = require("Storage").read("test.map", 0, 200000);
it seems to work but i get a string and i'd rather like to turn my arraybuffer into various arrays.is there a size limit on readArrayBuffer and is there a reason for it ? do you know any kind of workaround i could use ?
thanks.
-
-
-
-
hi,
i've been developping my app for a few days and this morning i started seeing strange messages in the web ide. when running the code i got something like : uncaught syntax error got EOF in bootupdate.js
i did not pay much intention since the app went to run anyway.
however i now have the following problems :
- no bluetooth (everything fails with some 'bluetooth' message on the watch face)
- when i go to the menus i get an extra 'updating boot0' screen between each menus
- the clock now does not use the timezones anymore
i tried to reflash the firmware going into dfu mode with the android app
and i think it went succesfullybut still, the watch did not go back to life.
this is a brand new watch i bought a few days ago.
anyone met something like that ? any way to reset the watch ?
help ?
- no bluetooth (everything fails with some 'bluetooth' message on the watch face)
yes, this guy : https://pastebin.com/D5k8NFhh
is not freeing the memory.
when i start the go_to method line 358 i have little memory remaining.
however commenting out line 358 and removing comments 572-577 it works.