Comments (9)
these days std::string is easier. See this example.
from esp8266-react.
from esp8266-react.
all stl/std libraries take some space, but its not too much and a lot simpler than writing your own string functions. If you use String correctly you won't get into problems with stability and I think rjwats knows what he's doing. However if memory is a problem then you shouldn't really use react and look at preact which has a much smaller footprint. I'm seeing if I can port some of this to preact as an experiment.
from esp8266-react.
from esp8266-react.
If you are having memory leak issues I'd be interested in seeing the code and conditions under which you are experiencing the issues.
I have a SoapUI project which I use locally to load-test the projects endpoints (1000s of requests to each endpoint) before I merge changes - memory leaks would be fairly awful.
I haven't experienced any memory leaks to date, though it is of course possible a change in the esp core or libraries used could have introduced a problem. Do you have any more details of why you think you have a memory issue? I could send you my SoapUI project (or check it in) so you can run the tests yourself.
Let me know!
from esp8266-react.
Are we talking about same memory? Im talking about heap memory.
std::string supports “Small String Optimization” (SSO) meaning it stores short strings locally and only uses the heap for long strings. By reducing the number of small objects in the heap, the SSO reduces the fragmentation which can lead to memory problems you see with the Arduino String class.
If you want to monitor memory, put something like
in setup()
static uint32_t _heap = ESP.getFreeHeap();
in loop()
uint32_t total_memory = _heap;
uint32_t free_memory = ESP.getFreeHeap();
Serial.printf("Free Heap: %d bytes initially | %d bytes used (%2u%%) | %d bytes free (%2u%%)",
total_memory,
total_memory - free_memory,
100 * (total_memory - free_memory) / total_memory,
free_memory,
100 * free_memory / total_memory);
from esp8266-react.
@rjwats I'm progressing on implementing some of those changes I talked about before (centralizing settings, mqtt, syslog, telnet console etc) and will upload soon to my GitHub fork. I was wondering if you would mind sharing the SoapUI project so I can also bash the end-points to make sure its stable?
from esp8266-react.
Looking forward to seeing what you've done and to see what can be brought over to the core. Did you find a clean approach for managing settings in the end? Doing that in a modular way looked like it would be the most difficult bit.
Hoping to find some time over the xmas break to work on some of this myself - making the build modular for a start.
I'll try and remember to share the file when I get the chance, though might not be till tomorrow as I'm busy this evening.
from esp8266-react.
Think you can close this.
from esp8266-react.
Related Issues (20)
- Error npm start or build Error: ...API schema. - options.allowedHosts[0] should be a non-empty string. HOT 3
- Support to show user defined build version infomation in the about screen x.x.x. Also nice to expose an api that can return this infomation. This can be handy if you want to mass update devices that meet a version criteria.
- Help me understand why "We want the device to come up in opmode=0 (WIFI_OFF)" (WiFiSettingsService.cpp)
- ESP32 light sleep mode and WiFi on/off
- websocket (WS_EVT_DATA) event from client does not update state on esp8266 only HOT 1
- Add netBIOS name
- On Mobile after clicking on menu item it does not close drawer HOT 7
- Firebase Integration HOT 1
- [Question] Add a websocket based STOMP implementation
- How to use MQTT function
- How to buy a coffee? HOT 2
- Retain flag on MQTT topic & Last will & Testament message HOT 1
- Possibility to use a JsonArray instead of JsonObject in read/update method
- Using PreactJS instead of ReactJS to reduce bundle size HOT 8
- Merging 2 websockets into a single one
- esp32 bootloop with platform=espressif32 HOT 5
- Manual Set Time not accounting for DST Properly (Fix attached) HOT 1
- web interface
- Slider Issue
- Working Platformio packages versions HOT 1
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 esp8266-react.