-->
Page 1 of 4

in desperate need for RAM to run mqtt over TLS

PostPosted: Thu May 23, 2019 11:31 am
by maverickchongo
Hi,

I need to run mqtt over TLS with mutual authentication, but I don't enough free ram, do you guys have any ideas about what I could optimise to get more ram?

Any help is much appreciated!

Re: in desperate need for RAM to run mqtt over TLS

PostPosted: Thu May 23, 2019 12:23 pm
by rudy
In order to optimize, there needs to be a starting point. How can anyone do that without knowing more about what you have done?

How about this answer. Get rid of anything you don't really need.

Re: in desperate need for RAM to run mqtt over TLS

PostPosted: Thu May 23, 2019 4:47 pm
by davydnorris
I'm running MQTT over TLS1.2 at the moment and have no problems, so it definitely can be done.

Have a look at the compiler settings put up in this thread and see if they help at all.

In addition you could generate a link map and see where your RAM is going

Re: in desperate need for RAM to run mqtt over TLS

PostPosted: Fri May 24, 2019 5:26 am
by maverickchongo
@davydnorris

Thanks for your answer.

In a simple project with no much running (only the basic) I am also able to run mqtt over TLS, I have done some tests and found that when the free heap memory goes below 38k it is not able to do the handshake anymore.

In my current project I have only 31K of free ram, so I need to get about 7K more. Before I was on non-os sdk version 2 and by upgrading to version 3 I got about 15K more RAM (which left me with 31K of free RAM in total), that is why I asked this question here to see if there is something else I could upgrade...

My first thought was to upgrade to the LWIP version that @eriksl published here, he says he got 11Kb of free ram by doing so:

viewtopic.php?f=166&t=19443&p=81960&hilit=mdns#p81960

But having a closer look to his library looks like quite a big task getting rid of all the espconn layer on my project...

@davydnorris I'll try the two thing you suggested, thanks