Coder Social home page Coder Social logo

Comments (6)

lws-team avatar lws-team commented on June 22, 2024

I think you find you're just out of memory.

That's why I introduced the limitation, to make multiple connections queue sequentially.

For the lws test server, it opens 4 ws connections and the limit must be 4. But for a more typical situation with less ws connections 3 should be enough.

You can turn up mbedtls and / or openssl emulation debug level in sdkconfig to get more info.

from lws-esp32-factory.

johsely1234 avatar johsely1234 commented on June 22, 2024

Yes it is a memory problem on my side.

I used just the lws-factory-app for testing multiple connections.

The debug infos did not really help me for this, but I let them turned on for now.

One problem that I found on lws-side is probably a small memory leak. I put a heap output in the main loop:

while (!lws_service(context, 10)) {
         taskYIELD();
	printf("free heap: %d\n", xPortGetFreeHeapSize());
}

and connected and disconnected one client sequentially for multiple times. The outputs I got (memory after disconnect):

168828
166944
166332
166232
166132
166032

As it seems there are 100 Bytes which are not freed (after the 3rd disconnect). Even not if I let the program run longer.

from lws-esp32-factory.

lws-team avatar lws-team commented on June 22, 2024

It's a bit difficult to use this information to point the finger. After lws starts in factory, there will be various allocations (larger than 100 bytes) for context, vhost and per-vhost protocol that won't get returned, so I assume your starting point is after this.

But generally per-connection stuff is definitely handled well in lws, since we check it via valgrind on Linux, where it is completely clean.

If it's 100 bytes per connection, or otherwise grows, somebody should take care about it (dunno how though, there are no tools afaik). If it's 100 bytes, always one time, well...

from lws-esp32-factory.

johsely1234 avatar johsely1234 commented on June 22, 2024

Ok at some point it stabilizes, so its ok!

from lws-esp32-factory.

lws-team avatar lws-team commented on June 22, 2024

+/- 100 bytes is not worth my time to try to track it down. LWS itself is known to not have this problem.

100 bytes per connection, or 100 bytes per second ^^ would be bad for me too.

But 100 bytes one time, is something for contributors to send fixes for... right?

from lws-esp32-factory.

johsely1234 avatar johsely1234 commented on June 22, 2024

Yes it is only a few times the until the 3rd or 4th connection attempt, then it is stable on the same level of memory usage. So it is no problem.

Yeah, but I have to get other things done as well ;-)

Thanks for your great support anyway!

from lws-esp32-factory.

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.