microsoft / microsoft/pxt-microbit
Recording Extension: "record" block in a tight loop panics out-of-memory
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
Describe the bug
Having the [record audio clip] block in a tight look results in an out of memory error after a couple of seconds.
Assuming that the recording extension and/or CODAL layer reuses buffers, or destroys and recreates them, then we probably shouldn't be hitting this issue?
To Reproduce
Steps to reproduce the behavior:
- Add recording extension
- Add the code below
- Flash to a micro:bit V2.x
- Panic with error 022 is thrown in a couple of seconds from startup.
basic.showIcon(IconNames.Heart)
while (true) {
record.startRecording(record.BlockingState.Nonblocking)
}
Expected behavior
Not to run out of memory.
Screenshots
Already added.
micro:bit version (please complete the following information):
V2.x
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
makecode.microbit.org version: 6.0.10
Microsoft MakeCode version: 9.0.7
microbit runtime version: v2.2.0-rc6
codal-microbit-v2 runtime version: v0.2.55
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue on a micro:bit V2.x using the recording extension and the shown tight loop, starting at record.startRecording(record.BlockingState.Nonblocking). Inspect the recording extension and CODAL layer for buffer reuse or repeated allocation. Done means the loop no longer reaches panic error 022 or runs out of memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100