java - What is a StackOverflowError? -


what stackoverflowerror, causes it, , how should deal them?

parameters , local variables allocated on stack (with reference types object lives on heap , variable references object). stack typically lives @ upper end of address space , used heads towards bottom of address space (i.e. towards zero).

your process has heap, lives @ bottom end of process. allocate memory, heap can grow towards upper end of address space. can see, there potential heap "collide" stack (a bit tectonic plates!!!).

the common cause stack overflow bad recursive call. typically, caused when recursive functions doesn't have correct termination condition, ends calling forever. however, gui programming, it's possible generate indirect recursion. example, app may handling paint messages, and, whilst processing them, may call function causes system send paint message. here you've not explicitly called yourself, os/vm has done you.

to deal them you'll need examine code. if you've got functions call check you've got terminating condition. if have check when calling function have @ least modified 1 of arguments, otherwise there'll no visible change recursively called function , terminating condition useless.

if you've got no obvious recursive functions check see if you're calling library functions indirectly cause function called (like implicit case above).


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -