Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > finding functions with large stack frames???

Reply
Thread Tools

finding functions with large stack frames???

 
 
Armel
Guest
Posts: n/a
 
      04-26-2007
Hello,

i am trying to find a tool which would (from source code or .jar) tell
me the size of the stack frame for each java function.
I have a bug which causes a stack overflow but I do not have any
information. From the JIT x86 assembler code I could just infer that
there was a big stack frame (something like 12KB in the crashing
function call)... if some tool could tell the stack frame size per
function i'm sure I could get out of this problem in seconds...
does anyone know any such tool ?

please help
Regards
Armel

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      04-27-2007
On 26 Apr 2007 08:58:51 -0700, Armel wrote:
> i am trying to find a tool which would (from source code or .jar) tell
> me the size of the stack frame for each java function.


> I have a bug which causes a stack overflow but I do not have any
> information.


Why don't you have any information? The stack dump that comes with the
StackOverflowError should tell you where to start looking.

I think it's more likely that your stack *depth* has become too great,
for example in a recursive method (or set of mutually recursive
methods), not that one particular method has too many local variables.

/gordon

--
 
Reply With Quote
 
 
 
 
Joshua Cranmer
Guest
Posts: n/a
 
      04-27-2007
Armel wrote:
> Hello,
>
> i am trying to find a tool which would (from source code or .jar) tell
> me the size of the stack frame for each java function.
> I have a bug which causes a stack overflow but I do not have any
> information. From the JIT x86 assembler code I could just infer that
> there was a big stack frame (something like 12KB in the crashing
> function call)... if some tool could tell the stack frame size per
> function i'm sure I could get out of this problem in seconds...
> does anyone know any such tool ?
>
> please help
> Regards
> Armel
>


A stack frame overflow from too many function variables as opposed to a
poorly-written recursive call would require probably on the order of
hundreds, if not thousands, of local variables per function call.

Generally, when one gets a stack overflow, one gets the output like this:
....
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
at Foo.bar(Foo.java:23)
....

indicating that the termination for recursion is not properly working.
The best thing to do would be to print diagnostics (e.g. the argument
list) and squirrel away the error to /dev/null.
 
Reply With Quote
 
Armel
Guest
Posts: n/a
 
      05-03-2007
On 28 avr, 01:38, Joshua Cranmer <(E-Mail Removed)> wrote:
> Armel wrote:
> > Hello,

>
> > i am trying to find a tool which would (from source code or .jar) tell
> > me the size of the stack frame for each java function.
> > I have a bug which causes a stack overflow but I do not have any
> > information. From the JIT x86 assembler code I could just infer that
> > there was a big stack frame (something like 12KB in the crashing
> > function call)... if some tool could tell the stack frame size per
> > function i'm sure I could get out of this problem in seconds...
> > does anyone know any such tool ?

>
> > please help
> > Regards
> > Armel

>
> A stack frame overflow from too many function variables as opposed to a
> poorly-written recursive call would require probably on the order of
> hundreds, if not thousands, of local variables per function call.
>
> Generally, when one gets a stack overflow, one gets the output like this:
> ...
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> at Foo.bar(Foo.java:23)
> ...
>
> indicating that the termination for recursion is not properly working.
> The best thing to do would be to print diagnostics (e.g. the argument
> list) and squirrel away the error to /dev/null.- Masquer le texte des messages précédents -
>

in fact I do not master the executable itself, and I fear that there
is some eager catch which catches the stack overflow exception and
simply does nothing with it so no stack trace...

Armel

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does std::stack::pop() not throw an exception if the stack is empty? Debajit Adhikary C++ 36 02-10-2011 08:54 PM
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
stack frame size on linux/solaris of a running application stack Surinder Singh C Programming 1 12-20-2007 01:16 PM
"stack level too deep"... because Threads keep their "starting" stack Sam Roberts Ruby 1 02-11-2005 04:25 AM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments