Article View: borland.public.jbuilder.java.language
Article #398Re: StackOverflowException with a logging class
From: Arthur Ore
Date: Sat, 28 May 2005 15:42
Date: Sat, 28 May 2005 15:42
60 lines
3110 bytes
3110 bytes
Hi Scott,
If you've got 32000 lines of code, should be able to determine which line is
causing you problem in 15 or less debugging sessions, by using a kind of
binary chop with break points. (As Math.pow(2,15)=32768)
Set a break point roughly halfway through your code and debug. If you don't
get a stack overflow before the break point, then you know the problem is in
the second half of your code. You can then set another break point about 3/4
of the way though you code and narrow it down. If you get the stack overflow
in the first part of your program, leave your original breakpoint in place,
but add another breakpoint 1/4 through your code and re-debug.
I use this approach in conjunction with Alexey's method of displaying unique
messages to quickly track down the problem areas of code.
Arth
"scott" <spowell@rpsweb.com> wrote in message
news:42978357@newsgroups.borland.com...
>
> Alexei,
>
> Thanks for the suggestion.
>
> I've commented out all of the logger calls and the app runs
> without getting the Stack Overflow.
>
> So let's say the problem is in the logger.
>
> There are 4000+ requirements and probably 32,000 total calls to
> the logger methods. It could take a lot of "step over" clicks
> to wait for the logger to blow up.
>
> Dummy print statements seem problematic since that's basically
> what the logger does: writes to System.out.
>
> Can you suggest anything else?
>
> Could you see the hashtables growing large enough that they're
> causing the problem?
>
> I think stack overflows are typically recursion related, but I don't
> really see any chance for that in this code. Maybe I'm missing something.
>
> Scott
>
>
>
> "Alexey N. Solofnenko" <trelony@mail.ru> wrote:
>>Please try running the program in debugger or add dummy print statements
>>through out your code to see where stack overflow happens.
>>
>>- Alexey.
>>
>>--
>>Alexey N. Solofnenko {trelony at gmail.com}
>>home: http://trelony.cjb.net/
>
Technical Details
Message-ID:
<4298915e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!pd7cy1no!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42977f0e$1@newsgroups.borland.com> <42978135$1@newsgroups.borland.com> <42978357@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,1362cbd94d530932 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Arthur Ore" <nospamthx_arthur@nospamthx.co.uk> Newsgroups: borland.public.jbuilder.java.language References: <42977f0e$1@newsgroups.borland.com> <42978135$1@newsgroups.borland.com> <42978357@newsgroups.borland.com> Subject: Re: StackOverflowException with a logging class Date: Sat, 28 May 2005 16:42:42 +0100 Lines: 62 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 82.69.65.131 Message-ID: <4298915e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1117294942 82.69.65.131 (28 May 2005 08:42:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.usenet.com!pd7cy1no!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail