-
Notifications
You must be signed in to change notification settings - Fork 14
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
Display memory allocation failed #170
Comments
Hello! You're getting an out of memory error when creating a (second) framebuffer. Full explanation:The display driver uses a relatively large (compared to the total 512kb of memory) framebuffer to speed up drawing. Because the buffer is so large, there usually is only enough memory to create one of them, and if you somehow accidentally create a second one, you'll often get a memory error. So, I actually added a little warning in to help diagnose this exact situation! Troubleshooting (maybe solution):You may be calling the Display constructor twice in your code, somewhere. For an extremely simple example: DISPLAY = display.Display()
DISPLAY = display.Display() This code will cause that same warning to be printed (and may, or may not, cause the same memory error). If you're using any of the built-in MicroHydra modules that draw to the display, there's also a chance that the display is being created somewhere in the module's code, and then you're re-creating the display afterwards. (This shouldn't be happening. So if that is what's going on, I'll need to patch that out!). You can try moving your Display initialization code above any other code in your app (before the creation/initialization of any other objects), to see if that's whats going on. |
Hey, just to update you (or anyone else who finds this) about potential solutions: I recently encountered this error in a novel way. I was editing the main script for an app that had multiple files (An import-able directory with an When I tried hitting F5 in Thonny to test the script, I would get the I realized, in this case, this was happening because the file was being imported/run twice. The |
I'm trying to let the screen display a line of text, and this error message appeared:
I want to know how to solve this, and better, what caused it and how to prevent it.
Thanks,
Knox
The text was updated successfully, but these errors were encountered: