iamrunningaprogramthati ' vewritteninjavaineclipse.theprogramhasaverydeeplevelofrecursionforverylargeinputs.forsmallerinpure heprogramrunsfinehoweverwhenlargeinputsaregiven,I get the following error:
exceptioninthread ' main ' Java.lang.stack overflow error
canthisbesolvedbyincreasingthejavastacksizeandifso,how do I do this in Eclipse?
更新:
@谨慎的甜瓜,数据线Skeet
thecodeistraversingaparsetreerecursivelyinordertobuildupadatastructure.so, forexamplethecodewilldosomeworkusinganodeintheparsetreeandcallitselfonthenode ' stwo children,combiningtheirrresultstogivetheoheooode
thetotaldepthoftherecursiondependsonthesizeoftheparsetreebutthecodeseemstofail (withoutalargerstack ) whenthenumberofrecursiver
alsoi ' mprettysurethecodeisn ' tfailingbecauseofabugasitworksforsmallinputs。
解决方案
opentherunconfigurationforyourapplication (运行/运行配置应用程序.thenlookfortheapplicationsentryin ' Java应用程序'
theargumentstabhasatextboxvmarguments,enter-xss1m (orabiggerparameterforthemaximumstacksize ).thedefaultvalueis 512k byte