Skip to content

Serial monitor is a memory+CPU hog #2634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
daxliniere opened this issue Feb 16, 2025 · 3 comments
Closed
3 tasks done

Serial monitor is a memory+CPU hog #2634

daxliniere opened this issue Feb 16, 2025 · 3 comments
Assignees
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project

Comments

@daxliniere
Copy link

Describe the problem

I have been working on a program and, so I can tell where in the various loops I am, I have it serial print a single character at the start of each loop.

The trouble is that after a minute, the entire IDE starts to run very slowly. After a couple more minutes, it is unable to summon the CPU power required to compile code, let alone attempt to upload it. Even scrolling your code becomes impossible.
Unplug your USB cable from Arduino, and after a few seconds, everything becomes springy and light again.

To reproduce

Run this:

void setup() {
  Serial.begin(115200);
}

void loop() {
Serial.print("A");
loop2();
}

void loop2() {
Serial.print("B");
}

Expected behavior

Processing priority of the serial monitor should be lower than the text editor, compiler, and probably some other things, too.

Arduino IDE version

2.3.4

Operating system

Windows

Operating system version

10 Pro

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@daxliniere daxliniere added the type: imperfection Perceived defect in any part of project label Feb 16, 2025
@daxliniere
Copy link
Author

Additional info! I have just discovered that if you press the Clear Output button, most of the speed is restored... until it fills up again.

I have also decreased my baud rate, but the issue still stands.

@per1234 per1234 self-assigned this Feb 16, 2025
@per1234 per1234 added topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor labels Feb 16, 2025
@per1234
Copy link
Contributor

per1234 commented Feb 16, 2025

Hi @daxliniere . Thanks for taking the time to submit an issue.

I see we have another report about this at #934.

It is best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.


The workaround is to adjust your sketch code so that it will produce line breaks as appropriate to avoid the output of excessively long lines. In your sketch, this would be accomplished by simply changing the Serial.print calls to Serial.println:

void setup() {
  Serial.begin(115200);
}

void loop() {
Serial.println("A");
loop2();
}

void loop2() {
Serial.println("B");
}

@per1234 per1234 closed this as completed Feb 16, 2025
@per1234 per1234 added the conclusion: duplicate Has already been submitted label Feb 16, 2025
@daxliniere
Copy link
Author

Thanks for the professionalism of your replies to each of my recent bug reports, Per.
It seems like I keep finding known issues that have been known for a long time, some fore many years. Is it fair to say that the Arduino IDE is a dead project? Seems like tiny easy-fix things are not being fixed, and some big things are also not being fixed. Prehaps there is not enough money in Arduino LLC to pay for the correct amount of developers' time to fix these issues in a timely manner?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants