I'm working on a larger project for Netduino Plus. I was hoping to use System.Http.dll but it turns out that I'm running out of memory when I try to deploy the whole project. So I started looking how the memory is allocated.
First here are the assemblies that are included wiht the Netduino Plus firmware:
mscorlib (4.1.2821.0) (3880 RAM - 33236 ROM - 19134 METADATA) Microsoft.SPOT.Native (4.1.2821.0) (1144 RAM - 6516 ROM - 4479 METADATA) Microsoft.SPOT.Hardware (4.1.2821.0) (1752 RAM - 11440 ROM - 7371 METADATA) Microsoft.SPOT.Net (4.1.2821.0) (704 RAM - 5060 ROM - 2452 METADATA) System (4.1.2821.0) (872 RAM - 5992 ROM - 3206 METADATA Microsoft.SPOT.IO (4.1.2821.0) (740 RAM - 4620 ROM - 2522 METADATA) System.IO (4.1.2821.0) (1548 RAM - 13292 ROM - 5862 METADATA) Microsoft.SPOT.Hardware.SerialPort (4.1.2821.0) (508 RAM - 3440 ROM - 1527 METADATA) Microsoft.SPOT.Hardware.Usb (4.1.2821.0) (580 RAM - 3740 ROM - 1844 METADATA) SecretLabs.NETMF.Hardware (18.104.22.168) (256 RAM - 1108 ROM - 491 METADATA) Total: (10320 RAM - 88444 ROM - 48888 METADATA)
As you can see in total it consumes about 88KB of RAM and I think most of these libraries are essential for any project. Well maybe apart from Microsoft.SPOT.Hardware.Usb - I guess most of network devices won't need ot connect as USB client. But it gains us only about 4KB.
When I add System.Http to blank project I can deploy it but it leaves very little ROM left. Here are the additional assemblies:
Microsoft.SPOT.Net.Security (4.1.2821.0) (264 RAM - 1220 ROM - 606 METADATA) System.Net.Security (4.1.2821.0) (664 RAM - 4544 ROM - 1943 METADATA) System.Http (4.1.2821.0) (2976 RAM - 38160 ROM - 12831 METADATA)
So in total it will add almost 44KB ROM. Of this about 6KB is used for the security assemblies. I guess this is requried to support HTTPS. I don't need it for my project at the moment so it would be cool to turn it off. (Again, I wish .NET MF had a post compile linker like MonoTouch to strip the code that is not executed in the project).
According to the tech spec Netduino Plus has only 48KB ROM left for our code. So with System.Http it leaves us with only about 4KB. It's really not enough for anything beyond a most basic project. For example for my project I estimate at least 15KB be needed.
So for now System.Http is no go, and I will try to implement basic HTTP functions on my own. But I hope there is a way to reduce the size of these libraries somehow so we get at least 15-20KB ROM more.