-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
memory leak with math.log/exp #522
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
Comments
Please describe how exactly you run it, and see #510. |
I also get MemoryError. Even replacing math.log(1) with 0.0 gives MemoryError. I would say that it should not be running out of RAM so easily. |
And I get [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] |
The following also gives MemoryError:
gcc-4.8.2, 64-bit. |
Welcome to what I usually experienced with 4.8 on 32bit ;-). May I now push following?
Because I got too tired to stash/unstash it. When you apply it, you'll likely see that some nonsencial alloc request is coming in. It's actually random though, another phase of the moon you get nonsencial method called on str or int, another - segfault. |
But we need to keep m_malloc_fail not printing anything out for "production" code, since it is legit to return a MemoryError in some cases (eg tests/memoryerror.py). And what about on pyboard? |
That's why I didn't propose to enable it by default so far. ;-) So, let's decide if we're in "production" mode, or we've reached crux of writing a serious project - when we hit a hard problem, which lies on critical path to further progress. |
Well okay, i'll just have to remember not to flash the pyboards with this version :) |
Well, nope then, I'll better stash/unstash ;-). But let's have plan how to address this stuff (in #510). |
Also add some more debugging output to gc_dump_alloc_table(). Now that newly allocated heap is always zero'd, maybe we just make this a policy for the uPy API to keep it simple (ie any new implementation of memory allocation must zero all allocations). This follows the D language philosophy. Before this patch, a previously used memory block which had pointers in it may still retain those pointers if the new user of that block does not actually use the entire block. Eg, if I want 5 blocks worth of heap, I actually get 8 (round up to nearest 4). Then I never use the last 3, so they keep their old values, which may be pointers pointing to the heap, hence preventing GC. In rare (or maybe not that rare) cases, this leads to long, unintentional "linked lists" within the GC'd heap, filling it up completely. It's pretty rare, because you have to reuse exactly that memory which is part of this "linked list", and reuse it in just the right way. This should fix issue #522, and might have something to do with issue #510.
This evolves the API from 2.x (and breaks it). Playback devices are now separate from the samples themselves. This allows for greater playback flexibility. Two sample sources are audioio.RawSample and audioio.WaveFile. They can both be mono or stereo. They can be output to audioio.AudioOut or audiobusio.I2SOut. Internally, the dma tracking has changed from a TC counting block transfers to an interrupt generated by the block event sent to the EVSYS. This reduces the overhead of each DMA transfer so multiple can occure without using up TCs. Fixes micropython#652. Fixes micropython#522. Huge progress on micropython#263
When running
I am getting
Is that to be expected with current implementation of GC?
The text was updated successfully, but these errors were encountered: