Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 5 months ago.
EthernetInterface: RAM usage overrun
Hello,
I'm developing an application, using the EthernetInterface Library for a TCPIP server. After building the project, the RAM usage grows up to 112%. Without the EthernetInterface, the RAM usage is only at 17%.
I've tried different things and found out, that the initialization of the ethernet connections is growing up the RAM usage (Methode init of the class).
So I've downloaded the demo TCPIP_HelloWorld from the homepage and got also 108%.
What's wrong? Is it a software bug in the library, the RAM usage calculation or are there any parameters I can use to configure the RAM space for the ethernet interface?
Thank's for help,
Joachim
1 Answer
11 years, 5 months ago.
Is that just what it shows in the compiler window? The question then would be, does the program work? I do know the compiler doesn't always report RAM usage correct (for example you can reserve flash memory and it thinks you reserved ram memory). I also for example don't know if it might add the usage of ethernet ram (it has a special memory bank) to the total amount of ram used, without taking into account that that isn't all in the general purpose ram.
Hello Erik,
First, the RAM usage is what the compiler window displays. Second, it seams that the program runs, I didn't get any suspect reactions until now, but I'm handling not a big size of data to transfer at the moment (< 1kB). So maybe the dynamic space of the Heap has enough free space for the Stack.
Joachim
posted by 24 Jun 2013Well if it compiles + runs file you don't have to worry about that usage report, that is ram used at compile time, and if that really was more than is available it simply wouldn't run.
For RAM usage at runtime you can have a look at this question: https://mbed.org/questions/1202/RAM-and-FLASH-remaining/. In general it probably will be a good idea if possible to define data as 'const', so it is placed in flash memory (of course only possible if it never changes).
posted by 24 Jun 2013