G120 Ram Usage

I was going about adding more code for a G120 custom board.
I was about to add some more references for things like xml, http, cryptogrophy, etc.
I figured I would check how much memory was left, so added code below to show.

uint freemem = Microsoft.SPOT.Debug.GC(true);
Debug.Print("Free Ram = " + freemem);

Free Ram = ~6MB

Wow, I thought, how could my code eat up that much memory…I realize netMF + GHI takes some room also.

So, I loaded a program (shown lower down) that simply just prints ram available.
Ran this program and:

Free Ram =~7MB

Question: Does netMF + GHI assemblies require 7MB of RAM (at minimum)?

Memory is sectioned for many other things, like RLP, LCD buffer and custom heap. An example, if you create a very large bitmap (more than 720KB), this goes into a different memory section. I think this section (custom heap) was 2MB on G120 but not sure.

You will probably never run out of ram on G120, unless you have many images and even then you have many ways to resolve it. But if you ever did manage to, I would be very curious to see how you did it :slight_smile:


Another data point on understanding the characteristics of the G120

Would be interesting to see a RAM/Flash sectioning chart in the Specs of each board.

@ Reinhard Ostermeier - would be nice from a curiosity perspective but this is not typically needed by anyone.

@ Gus - But would prevent discussions like this :slight_smile:

@ Reinhard Ostermeier - nah, most people are lazy like me and would come with questions before reading the docs :wink:

No seriously, we will look into detailing this

1 Like