Ajarmar / universal-pokemon-randomizer-zx

Public repository of source code for the Universal Pokemon Randomizer ZX
GNU General Public License v3.0
583 stars 146 forks source link

[Help] Exception in thread "Thread-5" #669

Open Mantra1776 opened 1 year ago

Mantra1776 commented 1 year ago

When attempting to save/randomize Omega Ruby i get the following exception

Exception in thread "Thread-5" java.lang.OutOfMemoryError: Java heap space at com.dabomstew.pkrandom.ctr.NCCH.rebuildRomfs(NCCH.java:480) at com.dabomstew.pkrandom.ctr.NCCH.saveAsNCCH(NCCH.java:316) at com.dabomstew.pkrandom.romhandlers.Abstract3DSRomHandler.saveRomFile(Abstract3DSRomHandler.java:90) at com.dabomstew.pkrandom.Randomizer.randomize(Randomizer.java:680) at com.dabomstew.pkrandom.newgui.NewRandomizerGUI.lambda$performRandomization$111(NewRandomizerGUI.java:1023) at com.dabomstew.pkrandom.newgui.NewRandomizerGUI$$Lambda$155/1951424665.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

I understand running out of heap space, but how can i avoid/fix that?

Mantra1776 commented 1 year ago

Update: I fixed it. for those who need to know simply press the window key and search "view advanced system settings". at the bottom is "Enviroment Variables". Click that. On system variables add a new variable. Name it _JAVA_OPTIONS and set the value to -Xmx?????M with the ? being whatever number of megabytes. The number will be how much ram java is allowed to use. in my case it is -Xmx16384M as i have 128gb of ram and can afford to spare 16gb.