12-16-2017 18:46
12-16-2017 18:46
This error is caused by document.getElementById() executed in the long loop. Got rid of this error when cached all the references to SVG elements. That's really weird and most likely is a bug.
So, what does this error mean exactly? And what sort of GC is being used in Jerryscript?
12-22-2017 23:07
12-22-2017 23:07
@JonFitbit, please, answer this question, if you don't mind. It's important for everyone who would take the Fitbit SDK serious.
12-23-2017 21:43
12-23-2017 21:43
Ok, looks like I found an answer. GC uses tri-color mark-and-sweep algorithm, while objects still have 10-bits reference counters for the hard references. Thus, there could be no more than 1024 references to an object.
Looks like `document.getElemebtById()` call increments the reference counter for the DOM element, which finally causes this exception if you query elements every time you update the UI. The solution is to cache DOM references.
Hope that will help other people who will encounter the same problem. And sooner or later, they will :).
08-13-2018 17:39
08-13-2018 17:39
Hey, I am getting this error as well. Can you tell me how do you cache the references to SVG elements in fitbit SDK?
08-23-2018 09:44 - edited 08-23-2018 09:45
08-23-2018 09:44 - edited 08-23-2018 09:45
const $el = document.getElementById( 'id' );
Do it once on the top level, and then use $el everywhere. Do not call getElementById every time you have the UI update.
03-12-2020 12:33
03-12-2020 12:33
Can you provide a short example of how this is used? Or point me to someplace that may have one?
12-09-2021 05:06
02-01-2022 02:07