Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts

    java stackoverflowerror

    I get a StackOverflowError when I run my program, so I looked it up and found "Thrown when a stack overflow occurs because an application recurses too deeply." And yes, I do a LOT of recursion.... So I was wondering if this is a common problem and can be delt with easily, or do I just have to come up with a better algorithm?
    <JPM />

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It might not necessarily be that your algorithm is messed up, it might just be that you accidentally left out a condition or such to limit the amount/depth of recursion. Check your code to make sure you aren't lacking in that area, as it is unlikely that any reasonable task cannot be accomplished with finite memory through recursion.

    Hope that helps!

    Happy coding!

  • #3
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found the problem, it was exactly as you said... it never stopped.
    <JPM />


  •  

    Posting Permissions

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