This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Updated throwable and stacktrace printing patch


Hi,

On Thu, 2002-08-15 at 23:00, Per Bothner wrote:
> I'm somewhat concerned about doing lots of object allocation
> and method calls in an exception situation.  What happens if
> we've run out memory or stackspace?  Perhaps stackspace isn't
> a problem, because by the time we print out the exception
> we've already cut back the stack (to an exception handler).
> But what if we're out of heap space?

We do no real object allocation is done when the exception is
thrown/caught. Only fillInStackTrace() is called at that moment.
fillInStackTrace does one _JvMalloc of at most 128*sizeof(void*),
depending on the number of addresses given by backtrace().

Only when getCause() is called (probably because someone called
printStackTrace) are object allocations done. But when you get an
OutOfMemoryError you are probably already out of luck printing anything
unless you free some memory first.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]