1 / 3
May 2006

i'm a newbie , i know default stack memory is 128KB. i want to know how to increase stack memory in java.
Help me,please.
Thanks.

  • created

    May '06
  • last reply

    Nov '06
  • 2

    replies

  • 293

    views

  • 3

    users

Pass an appropriate option to your VM.
It's "-Xss" ("-Xss1024k" for example) option for Sun's Java.

6 months later

I am not sure how -Xss works.

I tried LABYR1 and got RZE - so I d/l the data, tried it and, sure enough, stack overflowed.

Now, here's a kicker: We practiced this set on Saturday and my Java solution passed. The thing is - guy was judging using Intel Mac. That's it. I couldn't believe it, so I tried all machines we have in the lab - couple of different Linux machines, Solaris, "regular" Mac, WinXP. All of them crashed. But not Intel Mac. Go figure.

So I tried -Xss and it wouldn't work. And in the end, almost randomly, I tried -Xcomp, and it worked. I am not quite sure what -Xcomp does, I guess it tells JVM to go into "compile mode" (whatever that means - default is "mixed mode").

Now, I recoded my Java solution in C and it passed. I have no idea why it would cause a stack overflow in Java if it doesn't in C.

So, my question: can you either increase the stack size or run java with -Xcomp?

Suggested Topics

Want to read more? Browse other topics in JAVA based languages or view latest topics.