This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
plotters_combined with PMS5003 blows up after a few minutes with MemoryError in update - replace with fixed size, circular buffer #19
Comments
kevinjwalters
changed the title
plotters_combined blows up after a few minutes with MemoryError in update
plotters_combined with PMS5003 blows up after a few minutes with MemoryError in update
Dec 22, 2020
Test this with interval 0.2 and passive mode to get the plot zipping along. |
|
|
After
|
kevinjwalters
pushed a commit
to kevinjwalters/EnviroPlus-FeatherWing
that referenced
this issue
Jan 6, 2021
Default is now based on the pixel dimensions of the screen but can be specified with width, height kwargs.
kevinjwalters
pushed a commit
to kevinjwalters/EnviroPlus-FeatherWing
that referenced
this issue
Jan 6, 2021
…ffer pimoroni#19. A single list is now preallocated at a fixed size and not replaced with slices to reduce continual allocations and fragmentation. Includes fix for calling update() several times before draw(). The full_refresh implementation now only clears the bitmap when it scrolls. Removed the commented-out code.
kevinjwalters
pushed a commit
to kevinjwalters/EnviroPlus-FeatherWing
that referenced
this issue
Jan 6, 2021
pimoroni#19. Adding new test with some patterns and variable number of values to look for bugs around scrolling.
kevinjwalters
pushed a commit
to kevinjwalters/EnviroPlus-FeatherWing
that referenced
this issue
Jan 6, 2021
…exceeded. pimoroni#19 Discarding data which cannot be stored by update() if internal buffer capacity is exceeded, exceptions can be thrown if auto_discard is set to False. plotters_combined relies upon data being discarded by update(whatever, draw=False) for plots not on screen. Updating plotters_test to perform 32 undrawn update() in test_twolinesfewdraws.
|
kevinjwalters
pushed a commit
to kevinjwalters/EnviroPlus-FeatherWing
that referenced
this issue
Jan 6, 2021
kevinjwalters
changed the title
plotters_combined with PMS5003 blows up after a few minutes with MemoryError in update
plotters_combined with PMS5003 blows up after a few minutes with MemoryError in update - replace with fixed size, circular buffer
Jan 7, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The example https://github.com/pimoroni/EnviroPlus-FeatherWing/blob/master/examples/plotters_combined.py is robust wrt memory usage until the PMS5003 is added on a Feather nRF52840 Express. With that additional sensor and associated graph it then blows up after about 15 minutes with a
MemoryError
:Assuming this isn't a leak there's probably some efficiency measure that can improve the situation here. Pre-allocation of
self.data_points
and storing number of valid entries would probably help. This is the approach taken here with an implementation of a circular buffer for the width of screen plus pendingextra_data
awaiting being drawn viadraw()
(plus 1 based on how the implementation works).A crude fix might be to allow the width of plot to be specified and simply reduce it from the default 160.
The text was updated successfully, but these errors were encountered: