Main Site Documentation

EMX: CLR_E_OUT_OF_MEMORY Error when building project with Visual Studio 2008 Professional


#1

Hi,

I Added a new class to my project and when building it comes CLE_E_OUT_OF_MEMORY Error. In This class i have 36 double type variables. When I comment out variables and getters/setters the error disappears. How much there is memory for variables in EMX?

Thank You
Jentze


#2

For a start, you MUST get Visual C# Express 2010 (or a 2010 version of VS) if you’re using the current 4.1 SDK.

And if you’re using an older SDK you may just be hitting an old bug that’s now fixed (although I doubt it). Ultimately, unless you have a reason not to, then you need to move to the latest SDK

OOM errors are usually easiest to debug when you monitor GC output over time, so it’ll help if you share what you see there. (edit: when BUILDING. GC won’t help here :slight_smile: sorry )

If you’re worried about having 36 of these objects have you tried 1 and seen whether that works - and if it does then you don’t have to worry about whether it’s a valid thing to use yeah :wink:

And finally, OOM errors are usually coding errors. Get back to the smallest code sample that shows the fault and share that with us again.


#3

Post your code so we can try and help you…

copy and paste your code inbetween the code tag above!

Cheers Ian


#4

Hi,

The current running version GC looks like this:

GC: 598msec 767004 bytes used, 13388088 bytes available
Type 0F (STRING ): 2208 bytes
Type 11 (CLASS ): 14172 bytes
Type 12 (VALUETYPE ): 156 bytes
Type 13 (SZARRAY ): 10836 bytes
Type 15 (FREEBLOCK ): 13388088 bytes
Type 16 (CACHEDBLOCK ): 698436 bytes
Type 17 (ASSEMBLY ): 19056 bytes
Type 18 (WEAKCLASS ): 48 bytes
Type 1B (DELEGATE_HEAD ): 1728 bytes
Type 1C (DELEGATELIST_HEAD ): 276 bytes
Type 1D (OBJECT_TO_EVENT ): 1128 bytes
Type 1E (BINARY_BLOB_HEAD ): 4416 bytes
Type 1F (THREAD ): 4224 bytes
Type 20 (SUBTHREAD ): 528 bytes
Type 21 (STACK_FRAME ): 5016 bytes
Type 23 (LOCK_HEAD ): 60 bytes
Type 24 (LOCK_OWNER_HEAD ): 24 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD): 48 bytes
Type 27 (FINALIZER_HEAD ): 1104 bytes
Type 31 (IO_PORT ): 1152 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
Type 36 (APPDOMAIN_ASSEMBLY ): 2316 bytes

I hope this helps.

I’m currently changing the class.

Best Regards
Jentze

Best Regards
Jentze


#5

Hi,

Here is the code which does not any more cause the CLR_E_OUT_OF_MEMORY error, but when I take off the block comments the error occurs.


/*	
**	File:			HeatRecoverySettings.cs
**	Description:	Heat Recovery Settings
**	Author:			Aarni Jäntti
**					+358-504675562
**					aarni.jantti@ gsd.fi
**	Date:			16.03.2011
**
*/


using System;
using System.Text;
using System.Collections;
using System.IO;
using Microsoft.SPOT;
using Microsoft.SPOT.IO;


namespace GSD.MF.Utilities
{

    public sealed class HeatRecoverySettings
    {
        static readonly HeatRecoverySettings instance = new HeatRecoverySettings();


        private double airdensity = 1.2;
        private double duct1widthinlet = 0.0;
        private double duct2widthinlet = 0.0;
        private double duct1heightinlet = 0.0;
        private double duct2heightinlet = 0.0;
        private double duct1surfaceinlet = 0.0;
        private double duct2surfaceinlet = 0.0;
/*
        private double ductround1diameterinlet = 0.0;
        private double ductround1amountinlet = 0.0;
        private double ductround1surfaceinlet = 0.0;
        private double ductround2diameterinlet = 0.0;
        private double ductround2amountinlet = 0.0;
        private double ductround2surfaceinlet = 0.0;
        private double ducttotalsurfaceinlet = 0.0;

        private double duct1widthexhaust = 0.0;
        private double duct2widthexhaust = 0.0;
        private double duct1heightexhaust = 0.0;
        private double duct2heightexhaust = 0.0;
        private double duct1surfaceexhaust = 0.0;
        private double duct2surfaceexhaust = 0.0;

        private double ductround1diameterexhaust = 0.0;
        private double ductround1amountexhaust = 0.0;
        private double ductround1surfaceexhaust = 0.0;
        private double ductround2diameterexhaust = 0.0;
        private double ductround2amountexhaust = 0.0;
        private double ductround2surfaceexhaust = 0.0;
        private double ducttotalsurfaceexhaust = 0.0;

        private double heatrecoveryinlet = 0.0;
        private double heatingcapacityinlet = 0.0;
        private double airflowinlet = 0.0;
        private double heatrecoveryexhaust = 0.0;
        private double coolingcapacityexhaust = 0.0;
        private double airflowexhaust = 0.0;
        private double yearbasedheatrecoveryexhaust = 0.0;
*/
 
        public double AirDensity { get { return airdensity; } set { airdensity = value; } }
        public double Duct1WidthInlet { get { return duct1widthinlet; } set { duct1widthinlet = value; } }
        public double Duct2WidthInlet { get { return duct2widthinlet; } set { duct2widthinlet = value; } }
        public double Duct1HeightInlet { get { return duct1heightinlet; } set { duct1heightinlet = value; } }
        public double Duct2HeightInlet { get { return duct2heightinlet; } set { duct2heightinlet = value; } }
        public double Duct1SurfaceInlet { get { return duct1surfaceinlet; } set { duct1surfaceinlet = value; } }
        public double Duct2SurfaceInlet { get { return duct2surfaceinlet; } set { duct2surfaceinlet = value; } }
    /*
            public double DuctRound1DiameterInlet { get { return ductround1diameterinlet; } set { ductround1diameterinlet = value; } }
            public double DuctRound1AmountInlet { get { return ductround1amountinlet; } set { ductround1amountinlet = value; } }
            public double DuctRound1SurfaceInlet { get { return ductround1surfaceinlet; } set { ductround1surfaceinlet = value; } }
            public double DuctRound2DiameterInlet { get { return ductround2diameterinlet; } set { ductround2diameterinlet = value; } }
            public double DuctRound2AmountInlet { get { return ductround2amountinlet; } set { ductround2amountinlet = value; } }
            public double DuctRound2SurfaceInlet { get { return ductround2surfaceinlet; } set { ductround2surfaceinlet = value; } }
            public double DuctTotalSurfaceInlet { get { return ducttotalsurfaceinlet; } set { ducttotalsurfaceinlet = value; } }

            public double Duct1WidthExhaust { get { return duct1widthexhaust; } set { duct1widthexhaust = value; } }
            public double Duct2WidthExhaust { get { return duct2widthexhaust; } set { duct2widthexhaust = value; } }
            public double Duct1HeightExhaust { get { return duct1heightexhaust; } set { duct1heightexhaust = value; } }
            public double Duct2HeightExhaust { get { return duct2heightexhaust; } set { duct2heightexhaust = value; } }
            public double Duct1SurfaceExhaust { get { return duct1surfaceexhaust; } set { duct1surfaceexhaust = value; } }
            public double Duct2SurfaceExhaust { get { return duct2surfaceexhaust; } set { duct2surfaceexhaust = value; } }
            public double DuctRound1DiameterExhaust { get { return ductround1diameterexhaust; } set { ductround1diameterexhaust = value; } }
            public double DuctRound1AmountExhaust { get { return ductround1amountexhaust; } set { ductround1amountexhaust = value; } }
            public double DuctRound1SurfaceExhaust { get { return ductround1surfaceexhaust; } set { ductround1surfaceexhaust = value; } }
            public double DuctRound2DiameterExhaust { get { return ductround2diameterexhaust; } set { ductround2diameterexhaust = value; } }
            public double DuctRound2AmountExhaust { get { return ductround2amountexhaust; } set { ductround2amountexhaust = value; } }
            public double DuctRound2SurfaceExhaust { get { return ductround2surfaceexhaust; } set { ductround2surfaceexhaust = value; } }
            public double DuctTotalSurfaceExhaust { get { return ducttotalsurfaceexhaust; } set { ducttotalsurfaceexhaust = value; } }

            public double HeatRecoveryInlet { get { return heatrecoveryinlet; } set { heatrecoveryinlet = value; } }
            public double HeatingCapacityInlet { get { return heatingcapacityinlet; } set { heatingcapacityinlet = value; } }
            public double AirFlowInlet { get { return airflowinlet; } set { airflowinlet = value; } }
            public double HeatRecoveryExhaust { get { return heatrecoveryexhaust; } set { heatrecoveryexhaust = value; } }
            public double CoolingCapacityExhaust { get { return coolingcapacityexhaust; } set { coolingcapacityexhaust = value; } }
            public double AirFlowExhaust { get { return airflowexhaust; } set { airflowexhaust = value; } }
            public double YearBasedHeatRecoveryExhaust { get { return yearbasedheatrecoveryexhaust; } set { yearbasedheatrecoveryexhaust = value; } }
    */

          public static HeatRecoverySettings Instance
          {
              get
              {
                  return instance;
              }
          }




          public object Save()
          {

              try
              {
                  if (SystemSettings.Instance.SdMounted)
                  {

                      if (!Directory.Exists(SystemSettings.Instance.SdVolumeInfo.RootDirectory + "\\System\\Settings"))
                      {
                          Directory.CreateDirectory(SystemSettings.Instance.SdVolumeInfo.RootDirectory + "\\System\\Settings");

                      }


                      FileStream f = File.Create(SystemSettings.Instance.SdVolumeInfo.RootDirectory + "\\System\\Settings\\HeatRecoverySettings.txt");
                      StreamWriter sw = new StreamWriter(f);

                      string[] pdata = ToDelimStr("\t").Split(new char[] { '\t' });

                      for (int i = 0; i < pdata.Length; i++)
                      {
                          sw.WriteLine(pdata[i]);
                      }



                      sw.Flush();
                      sw.Close();


                      return 0;
                  }
                  else
                  {
                      Debug.Print("Saving HeatRecoverySettings!  SD Card NOT Present!");
                      return -1;
                  }
              }
              catch (Exception )
              {
                  return -1;
              }

          }

          public object Load()
          {

              Debug.Print("Loading HeatRecoverySettings!");

              try
              {
                  if (SystemSettings.Instance.SdMounted)
                  {
                      if (File.Exists(SystemSettings.Instance.SdVolumeInfo.RootDirectory + "\\System\\Settings\\HeatRecoverySettings.txt"))
                      {
                          // Debug.Print("LOAD File Exists!");
                          FileStream f = File.OpenRead(SystemSettings.Instance.SdVolumeInfo.RootDirectory + "\\System\\Settings\\HeatRecoverySettings.txt");
                          StreamReader sr = new StreamReader(f);

                          ArrayList al = new ArrayList();

                          Boolean flag = true;
                          string line = "";
                          int lc = 0;

                          while (flag == true)
                          {
                              line = sr.ReadLine();

                              if (line.Length >= 1)
                              {
                                  lc++;
                                  Debug.Print("HeatRecoverySettings: lc = " + lc.ToString() + "  line = " + line);
                                  al.Add(line);
                              }
                              else
                              {
                                  flag = false;
                              }

                          }

                          Debug.Print("HeatRecoverySettings: al.Count = " + al.Count.ToString());

                          string[] s = (string[])al.ToArray(typeof(string));

                          Debug.Print("HeatRecoverySettings: s.Length = " + s.Length.ToString());


                          for (int i = 0; i < s.Length; i++)
                          {
                              Debug.Print("HeatRecoverySettings: i[" + i.ToString() + "] = " + s[i]);
                          }


                          sr.Close();


                          if (s.Length == 34)
                          {

                              airdensity = Double.Parse(s[0]);                       //0
                              duct1widthinlet = Double.Parse(s[1]);                //1
                              duct2widthinlet = Double.Parse(s[2]);                //2
                              duct1heightinlet = Double.Parse(s[3]);               //3
                              duct2heightinlet = Double.Parse(s[4]);               //4
                              duct1surfaceinlet = Double.Parse(s[5]);              //5
                              duct2surfaceinlet = Double.Parse(s[6]);              //6
                              /*
                            ductround1diameterinlet = Double.Parse(s[7]);        //7
                            ductround1amountinlet = Double.Parse(s[8]);          //8
                            ductround1surfaceinlet = Double.Parse(s[9]);         //9
                            ductround2diameterinlet = Double.Parse(s[10]);        //10
                            ductround2amountinlet = Double.Parse(s[11]);          //11
                            ductround2surfaceinlet = Double.Parse(s[12]);         //12
                            ducttotalsurfaceinlet = Double.Parse(s[13]);          //13

                            duct1widthexhaust = Double.Parse(s[14]);              //14
                            duct2widthexhaust = Double.Parse(s[15]);              //15
                            duct1heightexhaust = Double.Parse(s[16]);             //16
                            duct2heightexhaust = Double.Parse(s[17]);             //17
                            duct1surfaceexhaust = Double.Parse(s[18]);            //18
                            duct2surfaceexhaust = Double.Parse(s[19]);            //19

                            ductround1diameterexhaust = Double.Parse(s[20]);      //20
                            ductround1amountexhaust = Double.Parse(s[21]);        //21
                            ductround1surfaceexhaust = Double.Parse(s[22]);       //22
                            ductround2diameterexhaust = Double.Parse(s[23]);      //23
                            ductround2amountexhaust = Double.Parse(s[24]);        //24
                            ductround2surfaceexhaust = Double.Parse(s[25]);       //25
                            ducttotalsurfaceexhaust = Double.Parse(s[26]);        //26
                              */
                              //heatrecoveryinlet = Double.Parse(s[sc++]);              //27
                              //heatingcapacityinlet = Double.Parse(s[sc++]);           //28
                              //airflowinlet = Double.Parse(s[sc++]);                   //29
                              //heatrecoveryexhaust = Double.Parse(s[sc++]);            //30
                              //coolingcapacityexhaust = Double.Parse(s[sc++]);         //31
                              //airflowexhaust = Double.Parse(s[sc++]);                 //32
                              //yearbasedheatrecoveryexhaust = Double.Parse(s[sc++]);   //33                        
                
             

                              Debug.Print("Loading HeatRecoverySettings!  OK");
                              return 0;
                          }
                          else
                          {
                              Debug.Print("Loading HeatRecoverySettings!  Wrong length ERROR " + s.Length.ToString());
                              return -1;
                          }
                      }
                      else
                      {
                          Debug.Print("Loading HeatRecoverySettings!  ERROR File not found!");
                          return -1;
                      }
                  }
                  else
                  {
                      Debug.Print("Loading HeatRecoverySettings!  SD Card NOT Present!");
                      return -1;
                  }
              }
              catch (Exception )
              {
                  Debug.Print("Loading HeatRecoverySettings!  ERROR");
                  return -1;
              }

          }



          public string ToDelimStr(string d)
          {


              return airdensity.ToString() + d +               //0
               duct1widthinlet.ToString() + d +                //1
               duct2widthinlet.ToString() + d +                //2
               duct1heightinlet.ToString() + d +               //3
               duct2heightinlet.ToString() + d +               //4
               duct1surfaceinlet.ToString() + d +              //5
               duct2surfaceinlet.ToString();              //6
/*
               ductround1diameterinlet.ToString() + d +        //7
               ductround1amountinlet.ToString() + d +          //8
               ductround1surfaceinlet.ToString() + d +         //9
               ductround2diameterinlet.ToString() + d +        //10
               ductround2amountinlet.ToString() + d +          //11
               ductround2surfaceinlet.ToString() + d +         //12
               ducttotalsurfaceinlet.ToString() + d +          //13

               duct1widthexhaust.ToString() + d +              //14
               duct2widthexhaust.ToString() + d +              //15
               duct1heightexhaust.ToString() + d +             //16
               duct2heightexhaust.ToString() + d +             //17
               duct1surfaceexhaust.ToString() + d +            //18
               duct2surfaceexhaust.ToString() + d +            //19

               ductround1diameterexhaust.ToString() + d +      //20
               ductround1amountexhaust.ToString() + d +        //21
               ductround1surfaceexhaust.ToString() + d +       //22
               ductround2diameterexhaust.ToString() + d +      //23
               ductround2amountexhaust.ToString() + d +        //24
               ductround2surfaceexhaust.ToString() + d +       //25
               ducttotalsurfaceexhaust.ToString() + d +        //26

               heatrecoveryinlet.ToString() + d +              //27
               heatingcapacityinlet.ToString() + d +           //28
               airflowinlet.ToString() + d +                   //29
               heatrecoveryexhaust.ToString() + d +            //30
               coolingcapacityexhaust.ToString() + d +         //31
               airflowexhaust.ToString() + d +                 //32
               yearbasedheatrecoveryexhaust.ToString();        //33             
*/
          }


          public void CalculateHeatRecoveryValues()
          {
             // double min;
             // double exhaust;
             // double inlet;


                  Duct1SurfaceInlet = (Duct1WidthInlet * Duct1HeightInlet) / 0xF4240; //m2
                  Duct2SurfaceInlet = (Duct2WidthInlet * Duct2HeightInlet) / 0xF4240; //m2
              /*
                    DuctRound1SurfaceInlet = (((System.Math.PI / 4) * System.Math.Pow(DuctRound1DiameterInlet, 2)) * DuctRound1AmountInlet) / 0xF4240; //m2
                    DuctRound2SurfaceInlet = (((System.Math.PI / 4) * System.Math.Pow(DuctRound2DiameterInlet, 2)) * DuctRound2AmountInlet) / 0xF4240; //m2
                    DuctTotalSurfaceInlet = Duct1SurfaceInlet + Duct2SurfaceInlet + DuctRound1SurfaceInlet + DuctRound2SurfaceInlet;

                    Debug.Print("CalculateHeatRecoveryValues:      Duct1SurfaceInlet = " + Util.Instance.Round(Duct1SurfaceInlet, 100));
                    Debug.Print("CalculateHeatRecoveryValues:      Duct2SurfaceInlet = " + Util.Instance.Round(Duct2SurfaceInlet, 100));
                    Debug.Print("CalculateHeatRecoveryValues: DuctRound1SurfaceInlet = " + Util.Instance.Round(DuctRound1SurfaceInlet, 100));
                    Debug.Print("CalculateHeatRecoveryValues: DuctRound2SurfaceInlet = " + Util.Instance.Round(DuctRound2SurfaceInlet, 100));
                    Debug.Print("CalculateHeatRecoveryValues:  DuctTotalSurfaceInlet = " + Util.Instance.Round(DuctTotalSurfaceInlet, 100));


                    Duct1SurfaceExhaust = (Duct1WidthExhaust * Duct1HeightExhaust) / 0xF4240; //m2
                    Duct2SurfaceExhaust = (Duct2WidthExhaust * Duct2HeightExhaust) / 0xF4240; //m2
                    DuctRound1SurfaceExhaust = (((System.Math.PI / 4) * System.Math.Pow(DuctRound1DiameterExhaust, 2)) * DuctRound1AmountExhaust) / 0xF4240; //m2
                    DuctRound2SurfaceExhaust = (((System.Math.PI / 4) * System.Math.Pow(DuctRound2DiameterExhaust, 2)) * DuctRound2AmountExhaust) / 0xF4240; //m2
                    DuctTotalSurfaceExhaust = Duct1SurfaceExhaust + Duct2SurfaceExhaust + DuctRound1SurfaceExhaust + DuctRound2SurfaceExhaust;

                    Debug.Print("CalculateHeatRecoveryValues:      Duct1SurfaceExhaust = " + Util.Instance.Round(Duct1SurfaceExhaust, 100));
                    Debug.Print("CalculateHeatRecoveryValues:      Duct2SurfaceExhaust = " + Util.Instance.Round(Duct2SurfaceExhaust, 100));
                    Debug.Print("CalculateHeatRecoveryValues: DuctRound1SurfaceExhaust = " + Util.Instance.Round(DuctRound1SurfaceExhaust, 100));
                    Debug.Print("CalculateHeatRecoveryValues: DuctRound2SurfaceExhaust = " + Util.Instance.Round(DuctRound2SurfaceExhaust, 100));
                    Debug.Print("CalculateHeatRecoveryValues:  DuctTotalSurfaceExhaust = " + Util.Instance.Round(DuctTotalSurfaceExhaust, 100));



                    //AirFlows
                    AirFlowInlet = DuctTotalSurfaceInlet * Rtdb.Instance.Ai3; //m3/s
                    AirFlowExhaust = DuctTotalSurfaceExhaust * Rtdb.Instance.Ai4; //m3/s

                    Debug.Print("CalculateHeatRecoveryValues:   AirFlowInlet = " + Util.Instance.Round(AirFlowInlet, 100));
                    Debug.Print("CalculateHeatRecoveryValues: AirFlowExhaust = " + Util.Instance.Round(AirFlowExhaust, 100));

                    min = Util.Instance.Min(AirFlowExhaust, AirFlowInlet);

                    if (min > 0)
                    {
                        exhaust = AirFlowExhaust / min;
                        inlet = AirFlowInlet / min;
                    }
                    else
                    {
                        exhaust = 1;
                        inlet = 1;
                    }

                    HeatRecoveryExhaust = exhaust * ((Rtdb.Instance.Ai8 - Rtdb.Instance.Ai7) / (Rtdb.Instance.Ai8 - Rtdb.Instance.Ai5)) * 100;
                    HeatRecoveryInlet = inlet * ((Rtdb.Instance.Ai6 - Rtdb.Instance.Ai5) / (Rtdb.Instance.Ai8 - Rtdb.Instance.Ai5)) * 100;

                    Debug.Print("CalculateHeatRecoveryValues: HeatRecoveryExhaust = " + Util.Instance.Round(HeatRecoveryExhaust, 100));
                    Debug.Print("CalculateHeatRecoveryValues:   HeatRecoveryInlet = " + Util.Instance.Round(HeatRecoveryInlet, 100));


                    CoolingCapacityExhaust = (Rtdb.Instance.Ai8 - Rtdb.Instance.Ai7) * AirDensity * 1.0 * AirFlowExhaust; //kW
                    HeatingCapacityInlet = (Rtdb.Instance.Ai6 - Rtdb.Instance.Ai5) * AirDensity * 1.0 * AirFlowInlet; //kW

                    Debug.Print("CalculateHeatRecoveryValues: CoolingCapacityExhaust = " + Util.Instance.Round(CoolingCapacityExhaust, 100));
                    Debug.Print("CalculateHeatRecoveryValues:   HeatingCapacityInlet = " + Util.Instance.Round(HeatingCapacityInlet, 100));
              */

          }

    }

}


#6

There are somethings that you can improve for sure. Work with ArrayList in your load method - do not convert it to array of strings. In your save method you create a string out of all individual values and then you split it,just write the values directly to the stream, there is no need to do that extra work.


#7

Hi Architect,

Do you have any idea why the CLR_E_OUT_OF_MEMORY Error occurs when building project with visual studio 2008 professional. I do not have SDK 4.1 but 4.0.3. If You look at the GC listing from currently working version, is there something which points to memory problem?

Regards
jentze


#8

Can you please post your output window messages when you see the error.


#9

Hi,

Here is the picture of the ouput window.

Regards
jentze


#10

Can you make a small program that generates the error?
I mean no file access…etc
We can try it on version 4.1


#11

Hi,

Here is smallest code which generates the error when building the project. If I comment out the last getter/setter line (AirFlowExhaust) or any other then the error disappears.


/*	
**	File:			HeatRecoverySettings.cs
**	Description:	Heat Recovery Settings
**	Author:			Aarni Jäntti
**					+358-504675562
**					aarni.jantti@ gsd.fi
**	Date:			16.03.2011
**
*/


using System;
using System.Collections;
using System.IO;
using Microsoft.SPOT;


namespace GSD.MF.Utilities
{

    public sealed class HeatRecoverySettings
    {
        static readonly HeatRecoverySettings instance = new HeatRecoverySettings();


        private double airdensity = 1.2;
        private double duct1widthinlet = 0.0;
        private double duct2widthinlet = 0.0;
        private double duct1heightinlet = 0.0;
        private double duct2heightinlet = 0.0;
        private double duct1surfaceinlet = 0.0;
        private double duct2surfaceinlet = 0.0;

        private double ductround1diameterinlet = 0.0;
        private double ductround1amountinlet = 0.0;
        private double ductround1surfaceinlet = 0.0;
        private double ductround2diameterinlet = 0.0;
        private double ductround2amountinlet = 0.0;
        private double ductround2surfaceinlet = 0.0;
        private double ducttotalsurfaceinlet = 0.0;

        private double duct1widthexhaust = 0.0;
        private double duct2widthexhaust = 0.0;
        private double duct1heightexhaust = 0.0;
        private double duct2heightexhaust = 0.0;
        private double duct1surfaceexhaust = 0.0;
        private double duct2surfaceexhaust = 0.0;

        private double ductround1diameterexhaust = 0.0;
        private double ductround1amountexhaust = 0.0;
        private double ductround1surfaceexhaust = 0.0;
        private double ductround2diameterexhaust = 0.0;
        private double ductround2amountexhaust = 0.0;
        private double ductround2surfaceexhaust = 0.0;
        private double ducttotalsurfaceexhaust = 0.0;

        private double heatrecoveryinlet = 0.0;
        private double heatingcapacityinlet = 0.0;
        private double airflowinlet = 0.0;
        private double heatrecoveryexhaust = 0.0;
        private double coolingcapacityexhaust = 0.0;
        private double airflowexhaust = 0.0;

 
        public double AirDensity { get { return airdensity; } set { airdensity = value; } }
        public double Duct1WidthInlet { get { return duct1widthinlet; } set { duct1widthinlet = value; } }
        public double Duct2WidthInlet { get { return duct2widthinlet; } set { duct2widthinlet = value; } }
        public double Duct1HeightInlet { get { return duct1heightinlet; } set { duct1heightinlet = value; } }
        public double Duct2HeightInlet { get { return duct2heightinlet; } set { duct2heightinlet = value; } }
        public double Duct1SurfaceInlet { get { return duct1surfaceinlet; } set { duct1surfaceinlet = value; } }
        public double Duct2SurfaceInlet { get { return duct2surfaceinlet; } set { duct2surfaceinlet = value; } }

        public double DuctRound1DiameterInlet { get { return ductround1diameterinlet; } set { ductround1diameterinlet = value; } }
        public double DuctRound1AmountInlet { get { return ductround1amountinlet; } set { ductround1amountinlet = value; } }
        public double DuctRound1SurfaceInlet { get { return ductround1surfaceinlet; } set { ductround1surfaceinlet = value; } }
        public double DuctRound2DiameterInlet { get { return ductround2diameterinlet; } set { ductround2diameterinlet = value; } }
        public double DuctRound2AmountInlet { get { return ductround2amountinlet; } set { ductround2amountinlet = value; } }
        public double DuctRound2SurfaceInlet { get { return ductround2surfaceinlet; } set { ductround2surfaceinlet = value; } }
        public double DuctTotalSurfaceInlet { get { return ducttotalsurfaceinlet; } set { ducttotalsurfaceinlet = value; } }

        public double Duct1WidthExhaust { get { return duct1widthexhaust; } set { duct1widthexhaust = value; } }
        public double Duct2WidthExhaust { get { return duct2widthexhaust; } set { duct2widthexhaust = value; } }
        public double Duct1HeightExhaust { get { return duct1heightexhaust; } set { duct1heightexhaust = value; } }
        public double Duct2HeightExhaust { get { return duct2heightexhaust; } set { duct2heightexhaust = value; } }
        public double Duct1SurfaceExhaust { get { return duct1surfaceexhaust; } set { duct1surfaceexhaust = value; } }
        public double Duct2SurfaceExhaust { get { return duct2surfaceexhaust; } set { duct2surfaceexhaust = value; } }

        public double DuctRound1DiameterExhaust { get { return ductround1diameterexhaust; } set { ductround1diameterexhaust = value; } }
        public double DuctRound1AmountExhaust { get { return ductround1amountexhaust; } set { ductround1amountexhaust = value; } }
        public double DuctRound1SurfaceExhaust { get { return ductround1surfaceexhaust; } set { ductround1surfaceexhaust = value; } }
        public double DuctRound2DiameterExhaust { get { return ductround2diameterexhaust; } set { ductround2diameterexhaust = value; } }

        public double DuctRound2AmountExhaust { get { return ductround2amountexhaust; } set { ductround2amountexhaust = value; } }
        public double DuctRound2SurfaceExhaust { get { return ductround2surfaceexhaust; } set { ductround2surfaceexhaust = value; } }
        public double DuctTotalSurfaceExhaust { get { return ducttotalsurfaceexhaust; } set { ducttotalsurfaceexhaust = value; } }

        public double HeatRecoveryInlet { get { return heatrecoveryinlet; } set { heatrecoveryinlet = value; } }
        public double HeatingCapacityInlet { get { return heatingcapacityinlet; } set { heatingcapacityinlet = value; } }
        public double AirFlowInlet { get { return airflowinlet; } set { airflowinlet = value; } }

        public double HeatRecoveryExhaust { get { return heatrecoveryexhaust; } set { heatrecoveryexhaust = value; } }
        public double CoolingCapacityExhaust { get { return coolingcapacityexhaust; } set { coolingcapacityexhaust = value; } }

        public double AirFlowExhaust { get { return airflowexhaust; } set { airflowexhaust = value; } }


      public static HeatRecoverySettings Instance
      {
          get
          {
              return instance;
          }
      }

    }

}

Regards
Jentze


#12

Hi,

Picture of the Building error.

Regards
Jentze


#13

I have added your class to default Domino application. I am using VS2010 and latest firmware. No issues.


#14

Hi,

Line commentet out, no building error?

Is there some maximun code size?

Regards
jentze


#15

4.0 to 4.1 is not a lot of changes, any reason on why you are not updating to 4.1?


#16

Hi,

As you see (earlier picture of the Output window) there is not any compiling errors.

Also i just figured out that if i comment out some variables / getters/setters from any other class file, the error disappears.

regards
jentze


#17

Looks like you are not the only one:

http://netmf.codeplex.com/workitem/310


#18

Hi,

Ok, thanks Architect, so the Visual Studio 2008 Professional is the problem and i should do what Gus and Bret stated for updating to VS 2010 and SDK 4.1.

Thank You Very Much All

Regards
Jentze


#19

Hi,

Now I have updated to VS2010 and NETMF 4.1 and updated TinyBooter and Firmware to the lates version 4.1. I still got the same error and then I looked a bit closer the link from Architect http://netmf.codeplex.com/workitem/310 and understand that this is compiler problem which will be corrected in version NETMF 4.2?

Regards
jentze


#20

I would suspect a restriction of NETMF. I think I remember that double array [][] are not supported and leads to “violent” exception without clear message. May be this is somewhere connected. Can you change the way you allocate the arrays
ArrayList al = new ArrayList();
string[] s = (string[])al.ToArray(typeof(string));
I would suggest a test with may be fixed size.