Increasing stack size

I'm using an implementation of a variation on flood fill, and for the recursion depths needed, the default stack size isn't nearly enough. (For some reason, the stack size on Linux is plenty, but not on Windows, even though they're supposed to be the same.)

I've tried using the stack size VM options, and even variations thereof, and random recommendations:

-Xss2M

-ss2M

-oss2M

-Xoss2M

-server

I even tried upping these numbers to 32M, and it still runs out of stack space at the same level.

I tried running the test function from the command line instead of from the IDE I'm using, and still no change.

Any suggestions?

[687 byte] By [ndicksona] at [2007-10-3 1:06:44]
# 1

The -Xss option on Windows with releases before Mustang (including all of the 5.0 updates) is unable to affect the stack size of the primordial, or main, thread. Your best workaround would probably be to spawn your computation in a new thread. You might also consider using an explicit work list rather than extremely deep recursion.

kbrussela at 2007-7-14 18:03:22 > top of Java-index,Java HotSpot Virtual Machine,Specifications...