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.

  1. increase min/max heap size process

    runtime.getruntime().exec("java -xms2048m -xmx2048m -jar " + getcachedir() + "/clientupdater.jar");

  2. 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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -