Java out of memory -
i have class named cachedownloader client downloads unzips updates main jar, client. had problem because couldn't unzip new client , replace while in use, had make new jar (named clientupdater) unzip new client replace old, open new one.
clientupdater opens client no problem. cachedownloader cannot open clientupdater, gets out of memory error.
cachedownloader still downloads new files , unzips brunt of files, clientupdater unzip tiny zip file contains small client.
here how cachedownloader loads clientupdater:
runtime.getruntime().exec("java -jar " + getcachedir() + "/clientupdater.jar"); system.exit(0);
here full error message - http://gyazo.com/8105ffd4c35f5f6d4a68a770fedf8f92
hopefully enough context , information without being lengthy. question is, how can go fixing this? error says can increase reserved code cache, there negative side this? , how do anyway, google didn't show how explained did.
i'm pretty new java keep in mind.
you can try below steps fix this.
increase min/max heap size process
runtime.getruntime().exec("java -xms2048m -xmx2048m -jar " + getcachedir() + "/clientupdater.jar");
increase size of
reservedcodecachesize
e.g. -xx:reservedcodecachesize=256m more details here
you should use profiler visualvm , can find out more detail run time environment. e.g. memory, cpu, threads, heap size etc.
Comments
Post a Comment