Git Product home page Git Product logo

Comments (4)

miguelgrinberg avatar miguelgrinberg commented on September 24, 2024

Is there any chance any of the 436 lines that precede your microdot import are consuming a large part of your memory? You are calling this a "basic setup", but my definition of basic setup would be that you run the web server on its own. These devices have limited resources. If you don't pre-compile your sources, then you must import the largest files first, so that there is more memory available to the compiler. Or else, you should seriously consider pre-compiling, or better yet, freezing as much of your code and libraries as possible.

from microdot.

hagenbuch avatar hagenbuch commented on September 24, 2024

Thanks for answering so fast...

I had more code working before I encountered this problem. I stripped my code down to basically the minimum. In the 437 lines are functions that are not being used, that makes it so long. I have removed that function now, still with the same result. I even deactivated webrepl.

Could it be that there is a chain of exceptions within your code, each exception consuming heap space or something?

import threading

fails when I try that in the repl

Can I turn on debug somehow? I am not that familiar with micropython yet..

from microdot.

miguelgrinberg avatar miguelgrinberg commented on September 24, 2024

@hagenbuch Most MicroPython ports do not have threading. It is expected for that import to fail. If you are getting any errors, you have to show me the statements that you issued and the errors if you need me to comment on them.

I would suggest that you take hello.py from this repository and save it as your main.py, and see if that works or not. And as I said, if you get any errors, copy the full output here.

from microdot.

miguelgrinberg avatar miguelgrinberg commented on September 24, 2024

See https://microdot.readthedocs.io/en/latest/freezing.html for information on how to cross-compile and/or freeze your application and dependencies to reduce the memory footprint.

from microdot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.