i have developed chatting application using threads. but when i start my application system acts very slow and sometime exception occur that heap is full. i want to increase heap size of Java Virtual Machine. how can i do it?
Just increase the heap size of the JVM. All Java applications, even simple ones, consume a lot of memory. Take a look at this article explaining in detail how to increase the amount of memory available for your application; basically you'll need to pass a couple of extra parameters to the JVM when you invoke the java
command, like this:
java -Xms64m -Xmx256m HelloWorld
In the above command, I'm saying that the HelloWorld
program should have an initial heap size of 64MB and a maximum of 256MB. Try with these values and fiddle a bit with them until you find a combination of values that works for your application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With