Hi two questions if I can learn?
When you start a Java
process, it sets a default maxHeapMemory, which is the maximum heap memory that can be used by that process. You can pass a command-line argument to increase that, but depending on your application's memory usage, it still may not enough. Memory leaks is another problem that can eat up your memory (not releasing it for garbage collection) possibly causing out of memory issues. Setting the heap memory allocated in the beginning and maximum allowed heap memory depends on your application, its memory usage, you can judge, test and profile your application (for memory usage) for that.
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