Comments (8)
Is there any reason you think this?
I would not imagine it would, the size of a class instantiation is the same, regardless of it is declared static or not.
from esp8266scheduler.
Just adding a task seems to take 4k ram space.
class MemPrinter: public Task {
public:
virtual ~MemPrinter() {
}
virtual void loop() {
Serial.println(ESP.getFreeHeap());
delay(2000);
}
};
MemPrinter mem_printer;
MemPrinter mem_printer2;
MemPrinter mem_printer3;
//MemPrinter mem_printer4;
void setup(void) {
Serial.begin(115200);
delay(100);
//Scheduler.start(&mem_printer);
Serial.println("Ready");
Serial.print(F("MEM END: "));
Serial.println(ESP.getFreeHeap());
//Scheduler.begin();
}
void loop(void) {
Serial.println(ESP.getFreeHeap());
delay(2000);
}
from esp8266scheduler.
Wow, 4k seems heavy for a class. I don't have my rig setup at the moment, I will have to look into this sometime this week.
Thanks for reporting.
from esp8266scheduler.
Probably part of the problem came from Task.context that is a cont_t that have a
stack[CONT_STACKSIZE / 4];
and
#ifndef CONT_STACKSIZE
#define CONT_STACKSIZE 4096
#endif
I'm going to investigate further...
from esp8266scheduler.
Thanks for looking into it.
If this is the case, there is unfortunately nothing to do about it. The cont_t is a critical part in being able to save and restore task context.
from esp8266scheduler.
I assume this is resolved. Please reopen if this is still an issue.
from esp8266scheduler.
This maybe explains why I get a OOM error in the console (activated debug for SSL+HTMLClient) when making "heavy" use of the library.
- Without using the library (obviously no multitasking) have
36440 bytes free
in the heap before connecting to the host - With 5 tasks running, I measure
11008
(25k less) and the connection cannot be made.
My 5 tasks plus the main task exactly matches the bill (6*4k=24k). Does this sound correct to you?
I guess I'll have to try to reduce it to 2 tasks, which is a pity, the code was looking so elegant.
from esp8266scheduler.
Yes, that seem about right.
from esp8266scheduler.
Related Issues (20)
- Doesnt work if use function => while (Client.connected()) HOT 8
- No removing/stoping task HOT 3
- Problems with: while(WiFiMulti.run() != WL_CONNECTED){} HOT 11
- Overloading loop() HOT 8
- Arduino compatibility HOT 2
- Any online request causing delay on the main loop HOT 5
- Example using delay or yield in class instantiated in task HOT 7
- Removal of main Task to save ram HOT 1
- Allow for an extra "free" task HOT 8
- How can I stop the Task? HOT 1
- Add Scheduler.Stop(); HOT 1
- Documentation has a "typo" HOT 1
- Scheduler v0.1.0 incompatible with ESP8266-core-3.0.0 HOT 7
- Can't work with UniversalTelegramBot lib HOT 1
- non-blocking delay in non-member function HOT 4
- Calling yield and delay outside of tasks HOT 1
- Using ESP8266Scheduler to make HTTPS requests without blocking loop(). HOT 2
- cont_yield with ESP8266 Release 3.1.0 HOT 4
- cont_suspend was not declared in this scope HOT 3
- Build Issue with PlatformIO HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266scheduler.