How to deal with "java.lang.OutOfMemoryError: Java heap ...

文章推薦指數: 80 %
投票人數:10人

The default max heap size of 64 MB is from before J2SE 5.0. · 2 · The Sun/Oracle JVM has always been quite rigid about specifying the amount memory to use (and ... Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore Howtodealwith"java.lang.OutOfMemoryError:Javaheapspace"error? AskQuestion Asked 13years,11monthsago Modified 5monthsago Viewed 1.9mtimes 523 167 Iamwritingaclient-sideSwingapplication(graphicalfontdesigner)onJava5.Recently,Iamrunningintojava.lang.OutOfMemoryError:JavaheapspaceerrorbecauseIamnotbeingconservativeonmemoryusage.Theusercanopenunlimitednumberoffiles,andtheprogramkeepstheopenedobjectsinthememory.AfteraquickresearchIfoundErgonomicsinthe5.0JavaVirtualMachineandotherssayingonWindowsmachinetheJVMdefaultsmaxheapsizeas64MB. Giventhissituation,howshouldIdealwiththisconstraint? Icouldincreasethemaxheapsizeusingcommandlineoptiontojava,butthatwouldrequirefiguringoutavailableRAMandwritingsomelaunchingprogramorscript.Besides,increasingtosomefinitemaxdoesnotultimatelygetridoftheissue. Icouldrewritesomeofmycodetopersistobjectstofilesystemfrequently(usingdatabaseisthesamething)tofreeupthememory.Itcouldwork,butit'sprobablyalotworktoo. Ifyoucouldpointmetodetailsofaboveideasorsomealternativeslikeautomaticvirtualmemory,extendingheapsizedynamically,thatwillbegreat. javajvmout-of-memoryheap-memory Share Improvethisquestion Follow editedOct24,2020at14:58 BalusC 1.0m363363goldbadges35593559silverbadges35163516bronzebadges askedSep1,2008at1:10 EugeneYokotaEugeneYokota 93.2k4545goldbadges209209silverbadges313313bronzebadges 4 Thedefaultmaxheapsizeof64MBisfrombeforeJ2SE5.0.ForJ2SE8.0information,see"GarbageCollectorErgonomics"atdocs.oracle.com/javase/8/docs/technotes/guides/vm/…. – AndyThomas Apr8,2015at15:36 2 IfyoulandedherebecauseeveryOOMquestionisdupedtothisone,makesureyoualsocheckout:stackoverflow.com/questions/299659/…Itprovidesthesolutionforcleaningupmemoryreferences'justintime'beforetheOOM.SoftReferencesmaybethetoolthatsolvesyouractualproblem. – SteveSteiner Apr24,2018at20:13 TheSun/OracleJVMhasalwaysbeenquiterigidaboutspecifyingtheamountmemorytouse(andhavingsomeinterestingdefaultsifleftonitsown).ThatwasoneofthenicethingsoftheMicrosoftJVMbackthen-itwasfastanditcouldusewhatevermemorythemachinehad. – ThorbjørnRavnAndersen Feb21,2021at16:12 inmycaseImissedgradle.propertiesfiletoaddinmyproject – MohdQasim Mar14at7:30 Addacomment  |  30Answers 30 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 290 Ultimatelyyoualwayshaveafinitemaxofheaptousenomatterwhatplatformyouarerunningon.InWindows32bitthisisaround2GB(notspecificallyheapbuttotalamountofmemoryperprocess).ItjusthappensthatJavachoosestomakethedefaultsmaller(presumablysothattheprogrammercan'tcreateprogramsthathaverunawaymemoryallocationwithoutrunningintothisproblemandhavingtoexamineexactlywhattheyaredoing). Sothisgiventhereareseveralapproachesyoucouldtaketoeitherdeterminewhatamountofmemoryyouneedortoreducetheamountofmemoryyouareusing.OnecommonmistakewithgarbagecollectedlanguagessuchasJavaorC#istokeeparoundreferencestoobjectsthatyounolongerareusing,orallocatingmanyobjectswhenyoucouldreusetheminstead.Aslongasobjectshaveareferencetothemtheywillcontinuetouseheapspaceasthegarbagecollectorwillnotdeletethem. InthiscaseyoucanuseaJavamemoryprofilertodeterminewhatmethodsinyourprogramareallocatinglargenumberofobjectsandthendetermineifthereisawaytomakesuretheyarenolongerreferenced,ortonotallocatetheminthefirstplace.OneoptionwhichIhaveusedinthepastis"JMP"http://www.khelekore.org/jmp/. Ifyoudeterminethatyouareallocatingtheseobjectsforareasonandyouneedtokeeparoundreferences(dependingonwhatyouaredoingthismightbethecase),youwilljustneedtoincreasethemaxheapsizewhenyoustarttheprogram.However,onceyoudothememoryprofilingandunderstandhowyourobjectsaregettingallocatedyoushouldhaveabetterideaabouthowmuchmemoryyouneed. Ingeneralifyoucan'tguaranteethatyourprogramwillruninsomefiniteamountofmemory(perhapsdependingoninputsize)youwillalwaysrunintothisproblem.Onlyafterexhaustingallofthiswillyouneedtolookintocachingobjectsouttodisketc.Atthispointyoushouldhaveaverygoodreasontosay"IneedXgbofmemory"forsomethingandyoucan'tworkarounditbyimprovingyouralgorithmsormemoryallocationpatterns.Generallythiswillonlyusuallybethecaseforalgorithmsoperatingonlargedatasets(likeadatabaseorsomescientificanalysisprogram)andthentechniqueslikecachingandmemorymappedIObecomeuseful. Share Improvethisanswer Follow editedMar23,2019at8:44 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredSep1,2008at1:29 BenChildsBenChilds 4,28011goldbadge1919silverbadges99bronzebadges 2 9 OpenJDKandOracleJDKhavebundledprofiler-jvisualvm.IfyouwantmoreconveniencesI'dsuggestcommercialYourkit. – PetrGladkikh Apr17,2013at4:40 2 Usecloseunusedobjectandarray,sayresultsSet.close();fileOutputStream.close();fileOutputStream.flush();,IuseresultsSet.close()andwasworkingmagically. – MrSalesi Sep3,2021at22:35 Addacomment  |  148 RunJavawiththecommand-lineoption-Xmx,whichsetsthemaximumsizeoftheheap. Seeherefordetails. Share Improvethisanswer Follow editedMar23,2019at8:51 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredSep1,2008at5:00 DaveWebbDaveWebb 186k5757goldbadges307307silverbadges298298bronzebadges 2 5 Howtosetthisparameterforever?CauseI'musing'gradlewassemble'command. – Dr.jacky Jan19,2017at7:32 3 Run->RunConfigurations->Clickonarguments->insideVMargumentstype-Xms1g-Xmx2g – ArayanSingh May24,2018at18:38 Addacomment  |  98 Youcouldspecifyperprojecthowmuchheapspaceyourprojectwants FollowingisforEclipseHelios/Juno/Kepler: Rightmouseclickon RunAs-RunConfiguration-Arguments-VmArguments, thenaddthis -Xmx2048m Share Improvethisanswer Follow editedMar23,2019at8:49 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredFeb25,2011at18:45 allenhwkimallenhwkim 26.6k1616goldbadges8686silverbadges118118bronzebadges 3 1 hibighostkimandcuongHuyTo,whereis"Arguments"..icanabletoseeuptoRunConfiguration.Pleasetelme.Myneedtodownloadandstorenearly2000contactsfromgmail.Itcrashduetooutofmemoryexception – AndroidRaji Nov24,2012at5:49 @AndroiRaji:yourightclickyourmouseontotheJavaclassthathasarunnablemain(thatis"publicstaticvoidmain(String[]args)"),thenchooseRunAs-RunConfiguration.Then"Arguments"isthetabrightaftertheMain(youseethetabsMain,Arguments,JRE,Classpath,Source,Environment,Common). – CuongHuyTo Mar4,2014at10:06 Howwoulditbeforintellih? – Sal-laS Jul17,2020at6:47 Addacomment  |  69 Increasingtheheapsizeisnota"fix"itisa"plaster",100%temporary.Itwillcrashagaininsomewhereelse.Toavoidtheseissues,writehighperformancecode. Uselocalvariableswhereverpossible. Makesureyouselectthecorrectobject(EX:SelectionbetweenString,StringBufferandStringBuilder) Useagoodcodesystemforyourprogram(EX:UsingstaticvariablesVSnonstaticvariables) Otherstuffwhichcouldworkonyourcode. TrytomovewithmultyTHREADING Share Improvethisanswer Follow editedMar24,2019at6:41 answeredFeb1,2014at5:10 PeakGenPeakGen 20.6k8080goldbadges234234silverbadges427427bronzebadges 4 Thisissotrue.IamtryingtofixoneissuewhereI'mgettingOOMonAWTthreadbutifIusedifferentnewthread,IamnotgettingOOMissue.AllIcanfindonlineisincreaseheapsizeforAWTthread. – Ashish Feb11,2019at5:43 1 @Ash:Yes,fixthecoreprobleminsteadoflookingforplasters. – PeakGen Feb12,2019at7:59 GarbagecollectionandthememorymanagementapproachinJavawassupposedtosolveallthesemalloc-dealloccomplicationsofitspredecessors:(OfcourseIcompletelyagreewiththisanswerit'sjustashamethedefaultsdon'tmakeiteasytowritecodewithleandata-structuresthatarecleanedupASAP. – Davos Oct11,2019at11:51 5 Idonotagree.Youneedtosetittosomevalueinitially.Ifitturnsouttobeinsufficientitdoesnotnecessarilymeanthatyourapplicationisbad.Maybeyouweretoooptimistic.Itisavalidsolutiontosetittoahighervalueinthiscase. – ZsoltSky Jun10,2021at12:30 Addacomment  |  31 Bigcaveat----atmyoffice,wewerefindingthat(onsomewindowsmachines)wecouldnotallocatemorethan512mforJavaheap.ThisturnedouttobeduetotheKasperskyanti-virusproductinstalledonsomeofthosemachines.AfteruninstallingthatAVproduct,wefoundwecouldallocateatleast1.6gb,i.e,-Xmx1600m(mismandatoryotherwiseitwillleadtoanothererror"Toosmallinitialheap")works. NoideaifthishappenswithotherAVproductsbutpresumablythisishappeningbecausetheAVprogramisreservingasmallblockofmemoryineveryaddressspace,therebypreventingasinglereallylargeallocation. Share Improvethisanswer Follow editedMar23,2019at8:46 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredApr14,2009at13:34 DavidDavid 5,74055goldbadges3131silverbadges3939bronzebadges Addacomment  |  25 VMargumentsworkedformeineclipse.Ifyouareusingeclipseversion3.4,dothefollowing gotoRun-->RunConfigurations-->thenselecttheprojectundermavenbuild-->thenselectthetab"JRE"-->thenenter-Xmx1024m. AlternativelyyoucoulddoRun-->RunConfigurations-->selectthe"JRE"tab-->thenenter-Xmx1024m Thisshouldincreasethememoryheapforallthebuilds/projects.Theabovememorysizeis1GB.Youcanoptimizethewayyouwant. Share Improvethisanswer Follow editedMar23,2019at8:50 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredJun9,2011at20:48 loveallloveall 25133silverbadges22bronzebadges Addacomment  |  24 Iwouldliketoaddrecommendationsfromoracletroubleshootingarticle. Exceptioninthreadthread_name:java.lang.OutOfMemoryError:Javaheapspace ThedetailmessageJavaheapspaceindicatesobjectcouldnotbeallocatedintheJavaheap.Thiserrordoesnotnecessarilyimplyamemoryleak Possiblecauses: Simpleconfigurationissue,wherethespecifiedheapsizeisinsufficientfortheapplication. Applicationisunintentionallyholdingreferencestoobjects,andthispreventstheobjectsfrombeinggarbagecollected. Excessiveuseoffinalizers. Oneotherpotentialsourceofthiserrorariseswithapplicationsthatmakeexcessiveuseoffinalizers.Ifaclasshasafinalizemethod,thenobjectsofthattypedonothavetheirspacereclaimedatgarbagecollectiontime Aftergarbagecollection,theobjectsarequeuedforfinalization,whichoccursatalatertime.finalizersareexecutedbyadaemonthreadthatservicesthefinalizationqueue.Ifthefinalizerthreadcannotkeepupwiththefinalizationqueue,thentheJavaheapcouldfillupandthistypeofOutOfMemoryErrorexceptionwouldbethrown. Onescenariothatcancausethissituationiswhenanapplicationcreateshigh-prioritythreadsthatcausethefinalizationqueuetoincreaseataratethatisfasterthantherateatwhichthefinalizerthreadisservicingthatqueue. Share Improvethisanswer Follow editedMar23,2019at8:47 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredMar22,2016at18:35 RavindrababuRavindrababu 46.5k99goldbadges236236silverbadges206206bronzebadges Addacomment  |  19 Yes,with-XmxyoucanconfiguremorememoryforyourJVM. Tobesurethatyoudon'tleakorwastememory.TakeaheapdumpandusetheEclipseMemoryAnalyzertoanalyzeyourmemoryconsumption. Share Improvethisanswer Follow editedMar23,2019at8:53 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredOct9,2008at8:22 kohlermkohlerm 2,58611goldbadge1717silverbadges2020bronzebadges 1 2 JVMJ9VM007ECommand-lineoptionunrecognised:-XmxCouldnotcreatetheJavavirtualmachine.Downvote – PhilipRego Jan15,2019at22:28 Addacomment  |  11 Followbelowsteps: Opencatalina.shfromtomcat/bin. ChangeJAVA_OPTSto JAVA_OPTS="-Djava.awt.headless=true-Dfile.encoding=UTF-8-server-Xms1536m -Xmx1536m-XX:NewSize=256m-XX:MaxNewSize=256m-XX:PermSize=256m -XX:MaxPermSize=256m-XX:+DisableExplicitGC" Restartyourtomcat Share Improvethisanswer Follow editedMar23,2019at8:46 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredOct7,2013at10:56 PradipBhattPradipBhatt 65899silverbadges1515bronzebadges Addacomment  |  9 BydefaultfordevelopmentJVMusessmallsizeandsmallconfigforotherperformancerelatedfeatures.Butforproductionyoucantunee.g.(InadditionitApplicationServerspecificconfigcanexist)->(Iftherestillisn'tenoughmemorytosatisfytherequestandtheheaphasalreadyreachedthemaximumsize,anOutOfMemoryErrorwilloccur) -XmssetinitialJavaheapsize -XmxsetmaximumJavaheapsize -Xsssetjavathreadstacksize -XX:ParallelGCThreads=8 -XX:+CMSClassUnloadingEnabled -XX:InitiatingHeapOccupancyPercent=70 -XX:+UnlockDiagnosticVMOptions -XX:+UseConcMarkSweepGC -Xms512m -Xmx8192m -XX:MaxPermSize=256m(injava8optional) Forexample:OnlinuxPlatformforproductionmodepreferablesettings. Afterdownloadingandconfiguringserverwiththiswayhttp://www.ehowstuff.com/how-to-install-and-setup-apache-tomcat-8-on-centos-7-1-rhel-7/ 1.createsetenv.shfileonfolder/opt/tomcat/bin/ touch/opt/tomcat/bin/setenv.sh 2.Openandwritethisparamsforsettingpreferablemode. nano/opt/tomcat/bin/setenv.sh exportCATALINA_OPTS="$CATALINA_OPTS-XX:ParallelGCThreads=8" exportCATALINA_OPTS="$CATALINA_OPTS-XX:+CMSClassUnloadingEnabled" exportCATALINA_OPTS="$CATALINA_OPTS-XX:InitiatingHeapOccupancyPercent=70" exportCATALINA_OPTS="$CATALINA_OPTS-XX:+UnlockDiagnosticVMOptions" exportCATALINA_OPTS="$CATALINA_OPTS-XX:+UseConcMarkSweepGC" exportCATALINA_OPTS="$CATALINA_OPTS-Xms512m" exportCATALINA_OPTS="$CATALINA_OPTS-Xmx8192m" exportCATALINA_OPTS="$CATALINA_OPTS-XX:MaxMetaspaceSize=256M" 3.servicetomcatrestart NotethattheJVMusesmorememorythanjusttheheap.Forexample Javamethods,threadstacksandnativehandlesareallocatedinmemory separatefromtheheap,aswellasJVMinternaldatastructures. Share Improvethisanswer Follow editedMar23,2019at8:45 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredMay26,2016at12:00 MusaMusa 2,5082525silverbadges2424bronzebadges Addacomment  |  9 Ireadsomewhereelsethatyoucantry-catchjava.lang.OutOfMemoryErrorandonthecatchblock,youcanfreeallresourcesthatyouknowmightusealotofmemory,closeconnectionsandsoforth,thendoaSystem.gc()thenre-trywhateveryouweregoingtodo. Anotherwayisthisalthough,idon'tknowwhetherthiswouldwork,butIamcurrentlytestingwhetheritwillworkonmyapplication. TheIdeaistodoGarbagecollectionbycallingSystem.gc()whichisknowntoincreasefreememory.Youcankeepcheckingthisafteramemorygobblingcodeexecutes. //Mimimumacceptablefreememoryyouthinkyourappneeds longminRunningMemory=(1024*1024); Runtimeruntime=Runtime.getRuntime(); if(runtime.freeMemory()Compiler>Sharedbuildprocessheapsize Share Improvethisanswer Follow answeredFeb9at10:19 MortezaBandiMortezaBandi 61466silverbadges1717bronzebadges Addacomment  |  2 Regardingtonetbeans,youcouldsetmaxheapsizetosolvetheproblem. Goto'Run',then-->'SetProjectConfiguration'-->'Customise'-->'run'ofitspoppedupwindow-->'VMOption'-->fillin'-Xms2048m-Xmx2048m'. Share Improvethisanswer Follow editedMar23,2019at8:48 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredJun12,2017at22:56 htlbydgodhtlbydgod 18811silverbadge77bronzebadges Addacomment  |  1 IfthisissueishappeninginWildfly8andJDK1.8,thenweneedtospecifyMaxMetaSpacesettingsinsteadofPermGensettings. Forexampleweneedtoaddbelowconfigurationinsetenv.shfileofwildfly. JAVA_OPTS="$JAVA_OPTS-XX:MaxMetaspaceSize=256M" Formoreinformation,pleasecheckWildflyHeapIssue Share Improvethisanswer Follow editedAug28,2017at5:10 aristotll 7,82066goldbadges3232silverbadges5151bronzebadges answeredApr4,2017at15:52 satishsatish 1,47911goldbadge1010silverbadges44bronzebadges Addacomment  |  1 Ifyoukeeponallocating&keepingreferencestoobject,youwillfillupanyamountofmemoryyouhave. Oneoptionistodoatransparentfileclose&openwhentheyswitchtabs(youonlykeepapointertothefile,andwhentheuserswitchestab,youclose&cleanalltheobjects...it'llmakethefilechangeslower...but...),andmaybekeeponly3or4filesonmemory. Otherthingyoushoulddois,whentheuseropensafile,loadit,andinterceptanyOutOfMemoryError,then(asitisnotpossibletoopenthefile)closethatfile,cleanitsobjectsandwarntheuserthatheshouldcloseunusedfiles. Yourideaofdynamicallyextendingvirtualmemorydoesn'tsolvetheissue,forthemachineislimitedonresources,soyoushouldbecarefull&handlememoryissues(oratleast,becarefullwiththem). Acoupleofhintsi'veseenwithmemoryleaksis: -->Keeponmindthatifyouputsomethingintoacollectionandafterwardsforgetaboutit,youstillhaveastrongreferencetoit,sonullifythecollection,cleanitordosomethingwithit...ifnotyouwillfindamemoryleakdifficulttofind. -->Maybe,usingcollectionswithweakreferences(weakhashmap...)canhelpwithmemoryissues,butyoumustbecarefullwithit,foryoumightfindthattheobjectyoulookforhasbeencollected. -->Anotherideai'vefoundistodevelopeapersistentcollectionthatstoredondatabaseobjectsleastusedandtransparentlyloaded.Thiswouldprobablybethebestapproach... Share Improvethisanswer Follow editedMar23,2019at8:52 Hearen 6,98122goldbadges4848silverbadges5858bronzebadges answeredSep29,2010at7:47 SoulWandererSoulWanderer 30433silverbadges1010bronzebadges Addacomment  |  1 AndroidStudio File->InvalidateCachesandRestartsolveditforme:) Share Improvethisanswer Follow answeredMar14,2021at13:35 itzoitzo 1,1511212silverbadges1818bronzebadges Addacomment  |  1 Ifthiserroroccursrightafterexecutionofyourjunittests,thenyoushouldexecuteBuild->RebuildProject. Share Improvethisanswer Follow editedMay28,2021at7:35 answeredMay28,2021at7:28 samuelrusamuelru 11911silverbadge55bronzebadges Addacomment  |  1 IfthiserrorcomesupduringAPKgenerationinreact-native,cdintotheandroidfolderinyourprojectanddo: ./gradlewclean then ./gradlewassembleRelease Iferrorpersists,then,restartyourmachine. Share Improvethisanswer Follow editedSep10,2021at0:12 answeredAug29,2021at13:37 ChukwunazaekpereChukwunazaekpere 41633silverbadges88bronzebadges Addacomment  |  1 IfyouareusingAndroidStudiojustaddtheselineswithgradle.propertiesfile org.gradle.jvmargs=-Xmx2048m-XX:MaxPermSize=512m-XX:+HeapDumpOnOutOfMemoryError-Dfile.encoding=UTF-8 Share Improvethisanswer Follow answeredJan9at17:40 NeerajSinghNeerajSingh 99188silverbadges1515bronzebadges Addacomment  |  0 Ifeverythingelsefails,inadditiontoincreasingthemaxheapsizetryalsoincreasingtheswapsize.ForLinux,asofnow,relevantinstructionscanbefoundinhttps://linuxize.com/post/create-a-linux-swap-file/. Thiscanhelpifyou'ree.g.compilingsomethingbiginanembeddedplatform. Share Improvethisanswer Follow answeredNov11,2019at22:39 ncccnccc 1,01522goldbadges1111silverbadges1919bronzebadges Addacomment  |  0 ifyougotthiserrorwhenyoulauncheclipsebirt 1-youwillgointhefileoftheeclipseconfiguration 2-youmustopeneclipse.init 3-modifiedtheRAMmemory,youcanincreasethis,igiveanexample. myoldinformationwas: -Xmx128m -XX:MaxPermSize=128m thenewmodificationthatiopered: -Xmx512m -XX:MaxPermSize=512m thismodificationwillpermitmetoresolvejavaheapspacewhenilaunchmyreportinmybrowser. Thanks Share Improvethisanswer Follow answeredSep16,2020at16:19 AntoninDiouloAntoninDioulo 1133bronzebadges Addacomment  |  0 JavaOOMHeapspaceissuecanalsoarisewhenyourDBconnectionpoolgotfull. IfacedthisissuebecauseofmyHikariConnectionpool(whenupgradedtoSpringboot2.4.*)wasfullandnotabletoprovideconnectionsanymore(allactiveconnectionsarestillpendingtofetchresultsfromdatabase). IssueissomeofournativequeriesinJPARepositoriescontainORDERBY?#{#pageable}whichtakesaverylongtimetogetresultswhenupgraded. RemovedORDERBY?#{#pageable}fromallthenativequeriesinJPArepositoriesandOOMheapspaceissuealongwithconnectionpoolissuegotresolved. Share Improvethisanswer Follow editedMay12,2021at20:44 answeredApr22,2021at23:46 HaranathBoggarapuHaranathBoggarapu 12333silverbadges99bronzebadges Addacomment  |  Highlyactivequestion.Earn10reputation(notcountingtheassociationbonus)inordertoanswerthisquestion.Thereputationrequirementhelpsprotectthisquestionfromspamandnon-answeractivity. Nottheansweryou'relookingfor?Browseotherquestionstaggedjavajvmout-of-memoryheap-memoryoraskyourownquestion. TheOverflowBlog Measurableandmeaningfulskilllevelsfordevelopers SanFrancisco?MorelikeSanFrancis-go(Ep.468) FeaturedonMeta AnnouncingtheStacksEditorBetarelease! The[shopping]and[shop]tagsarebeingburninated Linked 13 HowtohandleOutOfMemoryErrorinJava? 2 HowtoallocatespacetoJAVAusingcommandline 5 IsthereanywaytohandleJavaheapspaceexception 2 NETBEANS:“java.lang.OutOfMemoryError:Javaheapspace” 1 Java-Heapmemory 2 Exceptioninthread"main"java.lang.OutOfMemoryError:JavaheapspaceerrorocurredwhileaddingvalueinArrayList 0 HowcanIfindwhatobjects/threadsarecausingheapspaceerrorinJava?(VisualVM,MemoryAnalyzer) 1 Howtofixjava.lang.OutOfMemoryError:Javaheapspaceerror? 0 java.lang.OutOfMemoryError:howtosetcorrectJavaparameters -1 "java.lang.OutOfMemoryError:Javaheapspace"occurredwhilereadingimageofsize330MB Seemorelinkedquestions Related 3798 HowdoIefficientlyiterateovereachentryinaJavaMap? 1239 Dealingwith"java.lang.OutOfMemoryError:PermGenspace"error 2556 HowdoIcalloneconstructorfromanotherinJava? 4544 HowdoIread/convertanInputStreamintoaStringinJava? 3941 HowdoIgeneraterandomintegerswithinaspecificrangeinJava? 2403 HowdoIdeclareandinitializeanarrayinJava? 922 Errorjava.lang.OutOfMemoryError:GCoverheadlimitexceeded 319 Couldnotreserveenoughspaceforobjectheap 3387 HowdoIconvertaStringtoanintinJava? 3605 HowcanIcreateamemoryleakinJava? HotNetworkQuestions Whywouldspacetraderspickupandoffloadtheirgoodsfromanorbitingplatformratherthandirecttotheplanet? Droppingnon-commutativeproductintheend WhatisDetectBalance? Ethicsofkeepingagiftcardyouwonataraffleataconferenceyourcompanysentyouto? Ifaspecieskeepsgrowingthroughouttheir200-300yearlife,what"growthcurve"wouldbemostreasonable/realistic? WhatisthedifferenceBetweenActiveAcousticsMonitoring(AAM)andPassiveAcousticsMonitoring(PAM)? Eggusinggeonodesnotworking GenerateallPossibilitiesofWords verticallymovingwings Achievedesiredalignmentofarrowsintikz-cddiagram WhatistheUbuntuServerGUIwifisetuppackage? Page-turningnumberofagraph Newchainslipping Agelimitformastersprogramingermany? Iscodathesamethingasacadence? WhatwasthebugfortheBitcoinvalueoverflowin2010? Possessiveswithgerunds DoesthetitleofamasterprogrammakesadifferenceforalaterPhD? LinkedListimplementationinc++withallfunctions AirbrakesonF-35behindthecockpit Doproblemconstraintschangethetimecomplexityofalgorithms? MathProofs-whyaretheyimportantandhowaretheyuseful? Notationshorthandfortwonotesgoinginquicksuccession Whywon'tthiselectromagnethomeexperimentwork? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-java Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?