SRAM allocation only with include

Hi,
I'm doing some stuff with an Arduino Fio. Now i have a problem that i cant understand:

// cuboManager.h

class cuboMem
{
public:
        //Set RGB led to RED
	cuboMem(){ analogWrite(9,255); analogWrite(10,0); analogWrite(11,0);}
};

And this is my arduino main code:

#include "cuboMem.h"

void setup() {
}

void loop(){
}

My LED turn on and is RED, but i only insert an include. Why cuboMem constructor is called?

And i have another related problem:

In my project cuboMem is a class with many vars and methods that use some library i write.
If i try to see free memory (with the method i have found in the arduino playgroud) e have only 1KB of free SRAM (half of Fio memory).
I haven't create a cuboMem instance, only the include.

Regards,
Andrea.

I would dispute that the constructor is being called.

int setFoo;
class foo
{
public:
	foo(){ setFoo = 1; };
};
#include "foo.h"
void setup ()
{
  Serial.begin (9600);
  Serial.println (setFoo);
}

void loop (){}

behaves as I would expect, as does

#include "foo.h"
void setup ()
{
  Serial.begin (9600);
  Serial.println (setFoo);
  foo mine;
  Serial.println (setFoo);
}

void loop (){}

You are doing stuff in the constructor that has no business being there. The constructor will likely be called before the init() method has set up the hardware, so diddling with the hardware is a waste of time.

Perhaps you've noticed functions like Serial.begin(), Ethernet.begin(), Wire.begin(). Now, perhaps, you know why they exist.

andreaT:
My LED turn on and is RED, but i only insert an include. Why cuboMem constructor is called?

I wouldn't expect it to be. If you take out the #include, does the LED still glow red? Do you have any other source or header files in your project that create an instance of cuboMem? For example, there seems to be some uncertainty about whether the header file you showed us is cuboManager.h or cuboMem.h. Have you really shown us all your code? It wouldn't need to be in your main .ino file in order to be executed.

AWOL:
I would dispute that the constructor is being called...

But my var is inside the class, so i think that a var instance is created when i create a class instance. Is this wrong?

PaulS:
You are doing stuff in the constructor that has no business being there. The constructor will likely be called before the init() method has set up the hardware, so diddling with the hardware is a waste of time.

Perhaps you've noticed functions like Serial.begin(), Ethernet.begin(), Wire.begin(). Now, perhaps, you know why they exist.

Thank you, but why the constructor is called if i don't create a var of "cuboMem" type?

PeterH:
I wouldn't expect it to be. If you take out the #include, does the LED still glow red? Do you have any other source or header files in your project that create an instance of cuboMem? For example, there seems to be some uncertainty about whether the header file you showed us is cuboManager.h or cuboMem.h. Have you really shown us all your code? It wouldn't need to be in your main .ino file in order to be executed.

I run only the code you see in my post before posting it. And there is the problem.
The only thing i don't copy is include guards

But my var is inside the class, so i think that a var instance is created when i create a class instance.

I don't see any variables.

Thank you, but why the constructor is called if i don't create a var of "cuboMem" type?

I don't see any proof that it is called.