Results 1 to 2 of 2
  1. #1
    saif.hakim is offline Member
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    0

    Default Changing the stack size

    Hi everyone,

    My program requires 664579 levels of recursion, but I get StackOverflow error. I read that I can change the stack size with the command line prompt: "java -Xss1024k". However, it seems that, at least with Java SE 1.6, it is also necessary to enter the class as well, like "java -Xss1024k myProgram"

    Unfortunately, I am unsure of how to write the path reference to my class. That is, I don't know what to put in place of "myProgram".

    Any help?

  2. #2
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    7

    Default

    Well, stack size configuration or no stack size configuration, you always have to specify the class name that you want to run. How else were you running your program before...??? So for example, you might write:

    java <options> -cp . com.mypackage.MyMainClass

    where <options> can be whatever you want-- stack size setting etc. You would generally end up specifying "cp ." to mean "set the class path to be the current directory".

    However, there may be a preferable option in any case. You can set the stack size in the Thread constructor, i.e. within your Java program rather than in the command line options.

Similar Threads

  1. Changing size of Array
    By ravian in forum New To Java
    Replies: 3
    Last Post: 06-05-2012, 09:17 PM
  2. Changing default Applet Viewer Size?
    By dsym@comcast.net in forum Java Applets
    Replies: 6
    Last Post: 08-27-2010, 07:42 PM
  3. changing font size
    By diggitydoggz in forum New To Java
    Replies: 1
    Last Post: 12-25-2008, 08:48 AM
  4. Replies: 3
    Last Post: 09-27-2008, 05:46 AM
  5. How to set a stack size. -Xss doesn't work
    By protonus in forum New To Java
    Replies: 4
    Last Post: 06-27-2008, 07:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •