An archive of community.esquilo.io as of Saturday January 26, 2019.

# Is there any way to log the memory usage of the Esquilo

JefferyS

Having memory problems, shut down everything I could. The web server is what I think is causing the memory issues. I ran it a long time yesterday checking temp every 2 seconds, may increase that a bit, but after several hours I started getting 500 errors and timeouts and eventually the web server wouldn't respond at all. My lcd display kept working so I know the program was still running and I have it blink and led too to show me it's still running.

I've gone from green to yellow to red when the web server I believe stops working. It also looks like the more browsers running the page the more memory it takes but not totally sure on that.

I'm wanting to setup a PID for some heaters but already having memory issues so not sure if it's going to be able to handle it and the temperature probes.

Thanks,

Jeffery

JefferyS

Yesterday was better. I did get time outs and 500 errors on my tablet so I restarted the tablet and used Firefox and didn't seem to have a problem the rest of the day though I have seen it on my laptop. Was using chrome on my tablet.

If would be cool if I could monitor the Esquilo, maybe a read only IDE that doesn't stop the running program when you go into it.

Is there any way to see how much memory a library takes? I know it may be more when it is processing but it would be cool to have a general idea of how much memory it's going to use.

Don't get me wrong, I think the Esquilo is awesome and probably haven't gotten this far if I had to use the Arduino mostly because my lack of C programming and all that. And the fact it has built in IDE and wireless and all the other stuff that isn't on the Arduino. I like the Arduino and it good too but for me the Esquilo is much easier to get going.

Jeffery

I guess I spoke too soon, just got a 500 error on my notebook though the memory looks fine at 72%. Yesterday I increased the get temperature to 3 seconds.

JefferyS

I'm sure everyone is tired of me and my silly questions but I was connected to the Esquilo a few days ago with the IDE running and then powered the Esquilo off and on. It is auto running the program so when it came up is was still running in the IDE.

I'm saying all this because I'm kind of getting the feeling that the memory issues maybe related to have the program auto run at startup then I go connect with the IDE and it stops the running program. Then I start it from the IDE. I'm wondering if it isn't cleaning out all the memory it should from the previous running of the program and then me going in a and running it again through the IDE just adds more to that making the memory much fuller.

Just a thought.

Jeffery

Scott_Shumate

A 500 error is an internal error and is kind of a catch all. I would have to see output from the browser's developer mode to see what it could be. In Chrome, go to More Tools->Developer mode and then click the Network tab. You should see a listing of all the network requests and their responses. Try posting the request and response for one that is causing the 500 error.

If you install the curl utility, you can query the Esquilo without running the IDE. Here is a debug RPC request to get the current memory usage. The format of the request and the response is JSON.

curl -d '{"method":"eosMem"}' http://10.0.0.191/rpc
{"result":{"size":251896,"used":124592,"high":124920}}[

You could run this in a loop to watch the memory usage.

We've got a lot of memory improvements coming in the next EOS release. We've managed to reduce the memory usage by about 20%.

JefferyS

Thanks a lot Scott. If I get the 500 again I'll get the information to you.

I'll try the curl too.

That's fantastic, I can't wait till the next EOS.

I hope it doesn't sound like I'm complaining, I think the Esquilo is awesome and just trying to figure things out.

I have lots of ideas that I want to use this for in our anodizing system besides getting the temperature of the sensors but it's doing a great job at that except for a few hiccups lol.

Thanks for all your hard work and patience with me learning this stuff.

Jeffery

JefferyS

Hi Scott, been trying to run the curl with no luck. Get errors like maybe the example code is not complete. I did change the IP to my Esquilo address.

Thanks,

Jeffery

JefferyS

I figured it out Scott, didn't read what you said clearly that the second line is the return data.

Thanks a lot for your help!

JefferyS

Hi Scott, been running the curl every once in awhile and this time the memory according to the curl is pretty high. {"result":{"size":251960,"used":204868,"high":233856}}

I'm guessing size is total memory and used is what is in use when this was run and high is what the highest it's used.

It's strange because the memory meter in the IDE only shows 57% at the time I ran the curl eosMem. To me I would think it would be using a little over half of the 251960.

Any thoughts?

The memory has been much lower as far as the IDE shows since I upgraded to .5 EOS

Scott_Shumate

The memory meter is showing you the usage of the free memory available for use by Squirrel programs. This does not account for the memory used by the operating system, networking, Squirrel VM, etc. The rpc call you are using with curl is reporting the raw value from the operating system and includes all dynamic memory. The free memory available to Squirrel will vary a bit depending on what services are enabled.

JefferyS

Ah, that makes since, thanks Scott.

I can't by chance run the eosMem through the web erpc? It would be cool if I could display it on my web page.

Thanks,

Jeffery

Scott_Shumate

function getMem()
{
return mem();
}

And add this somewhere to your JavaScript. Change the "available" ID to match the ID for your HTML element.

erpc("getMem", null, function(result) {
document.getElementById("available").innerHTML = result.size - result.used;
}

You could wrap the erpc call in a setInterval if you want it refreshed periodically.

JefferyS

Thanks Scott, that's great!