I have a Dell Inspiron 16 running Windows 11. The sketch, in question, has been running for months.When I try to start it, the results are a blank screen with a red dot and the system is locked up. I must do a Ctl, Alt, Del to make it stop,
The screen shows “Could not run the sketch . . .” in red.
In order to try and determine the problem, I inserted an exit() immediately after void Setup(). Same response.
Hello,
I occasionally get the same error and also end the task in Task Manager.
Sometimes it happens for no apparent reason and sketch runs fine afterwards.
Can you provide a minimal sketch to demonstrate this?
:)
The sketch has 12 tabs and is quite long. I removed as much as I could and, of course, it ran.
The one thought I had was perhaps, I have not properly handled maximum available memory in preferences.
Its currently 300.
From time to time, I find that a devious, difficult-to-find bug is nothing more than my own error. Such is the case with this one. My thanks and appreciation for those that even looked at this.
My BAD!
Welcome
The temporary folder consumes a large amount of memory on each reboot if some tasks are not completed. Software like antivirus and all software, when updated automatically, consumes more than you expect. This code shows how much memory sketch consumes
void draw() {
println("Memory usage: " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024 + "MB");
// Rest of your code...
}
Report if it’s accurate or not I have tested it using APDE
Hi @fredstout ,
It has happened to me… and you learn from it!
Some tools that may be of interest:
:)
Consider throttling back on print statements in draw() to monitor memory usage.
Reference:
:)