0

I'm doing image processing under processing.

In my case, I have to load certain pixel recursively.

But it always show error message:

crashed in event thread due to Timeout occurred while waiting for packet 387.

I think it happen due to too many recursion times. Because i can run the program properly when I limit recursion times.

The stop condition is well designed.I can process most image which doesn't need to run too many recursion times.

Is there any method to resize the stack to tolerate this numerous pixels?

David
  • 5
  • 3

1 Answers1

0

If you're just asking if there's a way to set the stack size, then google is your friend. Processing is written in Java, so googling things like "java set stack size" would be a good place to start.

In fact, the question has been asked on StackOverflow multiple times:

How to increase the Java stack size?

Java stack overflow error - how to increase the stack size in Eclipse?

Java Applet: Increase stack size

java set max stack size

Java default stack size

However, since you're using Processing, you'll have to export it as a runnable jar, or run your code from an IDE like eclipse.

A better solution would be to figure out why your recursion is going out of control and to fix that. Increasing the stack size will only help a little bit- you'll have the same problem, just with slightly larger images.

Community
  • 1
  • 1
Kevin Workman
  • 41,537
  • 9
  • 68
  • 107