Sketches behaving differently when the SERIAL MONITOR is activie

I am working on sketches and trying to find bugs/problems.

To help I put lines with Serial.print() to see what is going on.

Weirdly though if I have the machine plugged in, and run the sketch, it crashes.
However, SAME SKETCH, but no 'puta plugged in, it doesn't crash.

Well, ok, it does, but not at the same point that it did when the 'puta was plugged in monitoring.

So as an example the sketch just keeps rebooting if I have the computer plugged in.
If I unplug the machine it goes further but then hangs.

And no, Pins 0 and 1 are not being used.
(Well, not that I can see.)

Does any data pass from the computer to the Arduino?

No,

The sketch is uploaded and "runs".

Data is only sent from the Arduino to the PC.
Just simple prints either saying where it is or sending a bit of data so I know what is going on.

When the board is not connected to the computer, how is it powered?

Fair question.

External SMPS. 12v 2A.

Something else which is throwing me alonng this line is this:

Say I have a "working sketch".

Somewhere in it I put a:
Serial.print("blah blah");

When I upload it, the sketch fails.

If I remove that line, it works.

I know it sounds weird, but that is the honest truth to what I see happening.
If there are other problems in there somewhere of which I know nothing, I can't declare them here.

Are you close to the Flash or SRAM limits?

I really hope not.

lost_and_confused:
I really hope not.

Just hoping is not good enough. You need this:

http://www.arduino.cc/playground/Code/AvailableMemory

You need to comment out a few long strings in your code to run this code, if your code is already running out of SRAM. What you described is very much like SRAM is running out.

Well, we could debate this all day.
Or you could post code.