-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New app: pace #3565
base: master
Are you sure you want to change the base?
New app: pace #3565
Conversation
With a slight hack
@gfwilliams @thyttan @atjn I keep seeing memory errors with this but don't believe there's a memory leak in my code, any ideas?
And when I >reset()
=undefined
FW addr 0x0022afac fail
Status 0
FW addr 0x0022bbb0 fail
Status 0
FW addr 0x0022bbd0 fail
Status 0
FW addr 0x0022bc00 fail
Status 0
Execution Interrupted during event processing.
Interpreter error: [
"LOW_MEMORY",
"MEMORY"
] |
apps/pace/app.ts
Outdated
if (now - lastUnlazy > 30000) | ||
layout.forgetLazyState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if the layout's rects were accumulating, but this doesn't resolve the leak
e42e268
to
d447b5c
Compare
I'm quite ignorant about the layout module. I suppose its clear function wouldn't help? |
Thanks for the quick response! I'm afraid not, that just wipes the layout's part of the screen, but thanks for the suggestion - I'll dig more into the layout module. Although thinking about it, my app isn't using it too differently from others such as |
The app starts completely blank though and need two button presses just to display anything, so I feel like something's not right anyway. Maybe run https://github.com/espruino/EspruinoMemView and see if you can visibly see what looks like the issue. But I just noticed:
and at no point does anything seem to take anything out of
|
By the way, it's interesting that |
The GPS on my watch has never really worked so I unfortunately can't reproduce the issue. On the other hand, that is a pretty good indicator that your problem lies somewhere in the GPS handling. Taking a quick look at the code, my best bet is that you have made a mistake with this loop, which makes it loop infinitely: for(; ; i++) {
const split = splits[i + splitOffset];
if (split == null) break;
... |
Shall do - as far as I have seen, running the app as it stands reliably raises the error for me, perhaps the gradual increase in small memory usage (i.e. a
Interesting - the app for me starts with an initial split shown, that's quite odd!
Didn't know about this, amazing
I believe this is the issue, I expect my units are wrong, so it's adding to a split once per metre instead of once per K (or similar)
I'll see what I can find
Thanks for the pointer, but this is ok - if we had an issue here we'd see the app hanging since it would be an infinite loop :) |
time is total (or elapsed) time, duration is active time
Switched to using |
This allows a runner to view their current pace and, when paused, splits from their run