dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: what is stackoverflowerror?

  1. #1
    Join Date
    May 2005
    Posts
    15

    what is stackoverflowerror?

    i got stackoverflowerror from one example,
    that example here:
    http://www.codeguru.com/java/articles/139.shtml

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,267

    Re: what is stackoverflowerror?

    Have a look here

    and here

    and here
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  3. #3
    Join Date
    Apr 2004
    Posts
    20

    Re: what is stackoverflowerror?

    The StackOverFlowError is an Error Object thorwn by the Runtime System when it Encounters that your application/code has ran out of the memory.

    This featurs was added in j2sdk1.4.2.....

    For Example this code runs out of the memory...

    class SOFE{

    SOFE s=new SOFE();

    public static void main(String[] aa){

    SOFE ss=new SOFE();}}

    Hope this Helps.......

  4. #4
    Join Date
    Apr 2001
    Location
    South Africa, Jo'burg
    Posts
    680

    Re: what is stackoverflowerror?

    Quote Originally Posted by vinod143
    For Example this code runs out of the memory...

    class SOFE{

    SOFE s=new SOFE();

    public static void main(String[] aa){

    SOFE ss=new SOFE();}}

    Hope this Helps.......
    Why would this code run out of memory? I suppose you mean hyperthically?

    Does a OutOfMemory Error not occur when you run out of memory? I have never seen a StackOverflowError for lack of memory.

    The javadoc states
    Thrown when a stack overflow occurs because an application recurses too deeply.
    for StackOverflowError.

    FYI
    Memory allocated the JVM can be increased using -Xms100m and -Xmx200m command line switches. -Xms for minimum mem and -Xmx for maximum mem. Heap memory can be increased using -XX:PermSize=32m and -XX:MaxPermSize=96m, again for minimum and maximum.

    Byron

  5. #5
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: what is stackoverflowerror?

    Quote Originally Posted by Bnt
    Why would this code run out of memory?
    It would proabably end in a stack overflow before in runs out of memory...
    Code:
    class SOFE{
    SOFE s=new SOFE();   // <--the object is creating an instance of itself, witch inturn is creating an instance of itself... and so on...
    - petter

  6. #6
    Join Date
    Apr 2001
    Location
    South Africa, Jo'burg
    Posts
    680

    Re: what is stackoverflowerror?

    Ok, I see the recursion now, should've looked closer earlier, my apologies.

    Byron

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)