increasing stack size from javac

I need to increase the stack size from javac - as I get the StackOverflow error while compiling. It seems like one of the methods is way too large. I can't find the compiler options to set the stack size. Thanks for any help.
[233 byte] By [ran123a] at [2007-10-3 2:47:59]
# 1
I think if you pass a -J argument the rest of it is passed to the invoking JVM, so something like -J-Xms=512m or whatever the syntax is. See also my reply to your original post.
ejpa at 2007-7-14 20:36:46 > top of Java-index,Developer Tools,Java Compiler...
# 2

Yes, I read both the posts. Ideally, I'd like to compile it without modifying the code. I tried the javac -J-Xms512 option, but I get the foll, error:

Error occurred during initialization of VM

Incompatible initial and maximum heap sizes specified

In any case, I need to be increasing the stack size (not heap size), right? It seems like there should be an easy way to configure this or set this as a javac argument option. Thanks for any help.

ran123a at 2007-7-14 20:36:46 > top of Java-index,Developer Tools,Java Compiler...
# 3
Well you need to specify -Xmm as well if you increase -Xms, but there is also a -Xss option which sets the thread stack size.
ejpa at 2007-7-14 20:36:46 > top of Java-index,Developer Tools,Java Compiler...
# 4

I've tried the foll values for -Xmx (max heap size - 10m,16m,32m), -Xoss(max java stack size - 256k, 512k, 1024k) and -Xss(max native stack size - 64k,128k,256k,512k). None of them work. I still get the StackOverflowError.

A few clues on what is happening. There are about 800 else-ifs in the if-else-if. I got it to compile when I deleted about 200 else-ifs. Is there a way to get all of it to work?

ran123a at 2007-7-14 20:36:46 > top of Java-index,Developer Tools,Java Compiler...
# 5

That's a lot of if-elses and you are obviously straining things. The reason is simple - consider what those if-elses look like if you had all the implied {}'s in there:

if (a)

{

}

else

{

if (b)

{

}

else

{

if (c)

{

}

else

{

// etc

}

}

}

All the context for the first 'if' statement has to be retained while the second 'if' statement is processed, and for the 2nd 'if' while the 3rd 'if' is processed, and so forth. So there is a stack, so if there are enough if-else's it will overflow.

You best option is to try to find another way to process this. Is all this stuff really in the same bean, or can it be refactored? For example, is this Bean constructor really a factory method for a family of Beans that all have one boolean each?

ejpa at 2007-7-14 20:36:46 > top of Java-index,Developer Tools,Java Compiler...