What should be the JVM heap size (Xms Xmx) for JDK8 64-bit on Linux having physical memory of 16 GB RAM and 8...












0















I have 16GB of RAM and 8 CPU's on my Linux server with JDK8 x64 installed.



I have set up JVM heap size as below but keep getting java.lang.OutOfMemoryError



JAVA_OPTS="-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit


Any suggestions, what should be the minimum/maximum/PermGen heap size.










share|improve this question













closed as too broad by talex, Owen Pauling, apangin, greg-449, hellow Nov 16 '18 at 11:04


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 4





    That absolutely depends on the application you are running. Can you please give us some more insights on that?

    – TobiSH
    Nov 16 '18 at 7:09











  • keep getting java.lang.OutOfMemoryError More than you have

    – Scary Wombat
    Nov 16 '18 at 7:11






  • 2





    BTW. If you are running a Java 8 application you can get rid of -XX:MaxPermSize=1024m. This is no longer supported by Java8 ( The memory model used for loaded classes and methods is different and isn't limited (with default settings))

    – TobiSH
    Nov 16 '18 at 7:11











  • If you don't have a clue what is going on try to generate a heap dump: -XX:+HeapDumpOnOutOfMemoryError. Than you can see what consumes all the memory.

    – TobiSH
    Nov 16 '18 at 7:14






  • 1





    @PeterLawrey we can preclude permgen issues for a Java 8 installation.

    – Holger
    Nov 16 '18 at 9:20
















0















I have 16GB of RAM and 8 CPU's on my Linux server with JDK8 x64 installed.



I have set up JVM heap size as below but keep getting java.lang.OutOfMemoryError



JAVA_OPTS="-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit


Any suggestions, what should be the minimum/maximum/PermGen heap size.










share|improve this question













closed as too broad by talex, Owen Pauling, apangin, greg-449, hellow Nov 16 '18 at 11:04


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 4





    That absolutely depends on the application you are running. Can you please give us some more insights on that?

    – TobiSH
    Nov 16 '18 at 7:09











  • keep getting java.lang.OutOfMemoryError More than you have

    – Scary Wombat
    Nov 16 '18 at 7:11






  • 2





    BTW. If you are running a Java 8 application you can get rid of -XX:MaxPermSize=1024m. This is no longer supported by Java8 ( The memory model used for loaded classes and methods is different and isn't limited (with default settings))

    – TobiSH
    Nov 16 '18 at 7:11











  • If you don't have a clue what is going on try to generate a heap dump: -XX:+HeapDumpOnOutOfMemoryError. Than you can see what consumes all the memory.

    – TobiSH
    Nov 16 '18 at 7:14






  • 1





    @PeterLawrey we can preclude permgen issues for a Java 8 installation.

    – Holger
    Nov 16 '18 at 9:20














0












0








0








I have 16GB of RAM and 8 CPU's on my Linux server with JDK8 x64 installed.



I have set up JVM heap size as below but keep getting java.lang.OutOfMemoryError



JAVA_OPTS="-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit


Any suggestions, what should be the minimum/maximum/PermGen heap size.










share|improve this question














I have 16GB of RAM and 8 CPU's on my Linux server with JDK8 x64 installed.



I have set up JVM heap size as below but keep getting java.lang.OutOfMemoryError



JAVA_OPTS="-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit


Any suggestions, what should be the minimum/maximum/PermGen heap size.







java jvm 64bit heap-memory permgen






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 7:02









User_GUser_G

83




83




closed as too broad by talex, Owen Pauling, apangin, greg-449, hellow Nov 16 '18 at 11:04


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as too broad by talex, Owen Pauling, apangin, greg-449, hellow Nov 16 '18 at 11:04


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 4





    That absolutely depends on the application you are running. Can you please give us some more insights on that?

    – TobiSH
    Nov 16 '18 at 7:09











  • keep getting java.lang.OutOfMemoryError More than you have

    – Scary Wombat
    Nov 16 '18 at 7:11






  • 2





    BTW. If you are running a Java 8 application you can get rid of -XX:MaxPermSize=1024m. This is no longer supported by Java8 ( The memory model used for loaded classes and methods is different and isn't limited (with default settings))

    – TobiSH
    Nov 16 '18 at 7:11











  • If you don't have a clue what is going on try to generate a heap dump: -XX:+HeapDumpOnOutOfMemoryError. Than you can see what consumes all the memory.

    – TobiSH
    Nov 16 '18 at 7:14






  • 1





    @PeterLawrey we can preclude permgen issues for a Java 8 installation.

    – Holger
    Nov 16 '18 at 9:20














  • 4





    That absolutely depends on the application you are running. Can you please give us some more insights on that?

    – TobiSH
    Nov 16 '18 at 7:09











  • keep getting java.lang.OutOfMemoryError More than you have

    – Scary Wombat
    Nov 16 '18 at 7:11






  • 2





    BTW. If you are running a Java 8 application you can get rid of -XX:MaxPermSize=1024m. This is no longer supported by Java8 ( The memory model used for loaded classes and methods is different and isn't limited (with default settings))

    – TobiSH
    Nov 16 '18 at 7:11











  • If you don't have a clue what is going on try to generate a heap dump: -XX:+HeapDumpOnOutOfMemoryError. Than you can see what consumes all the memory.

    – TobiSH
    Nov 16 '18 at 7:14






  • 1





    @PeterLawrey we can preclude permgen issues for a Java 8 installation.

    – Holger
    Nov 16 '18 at 9:20








4




4





That absolutely depends on the application you are running. Can you please give us some more insights on that?

– TobiSH
Nov 16 '18 at 7:09





That absolutely depends on the application you are running. Can you please give us some more insights on that?

– TobiSH
Nov 16 '18 at 7:09













keep getting java.lang.OutOfMemoryError More than you have

– Scary Wombat
Nov 16 '18 at 7:11





keep getting java.lang.OutOfMemoryError More than you have

– Scary Wombat
Nov 16 '18 at 7:11




2




2





BTW. If you are running a Java 8 application you can get rid of -XX:MaxPermSize=1024m. This is no longer supported by Java8 ( The memory model used for loaded classes and methods is different and isn't limited (with default settings))

– TobiSH
Nov 16 '18 at 7:11





BTW. If you are running a Java 8 application you can get rid of -XX:MaxPermSize=1024m. This is no longer supported by Java8 ( The memory model used for loaded classes and methods is different and isn't limited (with default settings))

– TobiSH
Nov 16 '18 at 7:11













If you don't have a clue what is going on try to generate a heap dump: -XX:+HeapDumpOnOutOfMemoryError. Than you can see what consumes all the memory.

– TobiSH
Nov 16 '18 at 7:14





If you don't have a clue what is going on try to generate a heap dump: -XX:+HeapDumpOnOutOfMemoryError. Than you can see what consumes all the memory.

– TobiSH
Nov 16 '18 at 7:14




1




1





@PeterLawrey we can preclude permgen issues for a Java 8 installation.

– Holger
Nov 16 '18 at 9:20





@PeterLawrey we can preclude permgen issues for a Java 8 installation.

– Holger
Nov 16 '18 at 9:20












1 Answer
1






active

oldest

votes


















3














Out of memory error is caused, because the heap size consumed by your code is more than what is allocated by Java.



This could be because of multiple reasons.



1) Your code is bulky and needs more memory: A simple code to just print "Hello World" won't consume much memory. However, a lengthy and bulky application of 1 GB source code would consume huge memory. If that is case, you can try to increase your memory arguments.



2) Bad Code: Bad code, which consumes useless memory, and does not release it later, causes more heap size to be used continously than the garbage collected. If that is the code you might need to identify the issue with your code. You can actually identify the method or class that is consuming this huge amount of heap, using Java Flight Record (JFR).



Ideal Heap Memory Size varies from from case to case and your requirements must be known for exact heap size.






share|improve this answer
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Out of memory error is caused, because the heap size consumed by your code is more than what is allocated by Java.



    This could be because of multiple reasons.



    1) Your code is bulky and needs more memory: A simple code to just print "Hello World" won't consume much memory. However, a lengthy and bulky application of 1 GB source code would consume huge memory. If that is case, you can try to increase your memory arguments.



    2) Bad Code: Bad code, which consumes useless memory, and does not release it later, causes more heap size to be used continously than the garbage collected. If that is the code you might need to identify the issue with your code. You can actually identify the method or class that is consuming this huge amount of heap, using Java Flight Record (JFR).



    Ideal Heap Memory Size varies from from case to case and your requirements must be known for exact heap size.






    share|improve this answer






























      3














      Out of memory error is caused, because the heap size consumed by your code is more than what is allocated by Java.



      This could be because of multiple reasons.



      1) Your code is bulky and needs more memory: A simple code to just print "Hello World" won't consume much memory. However, a lengthy and bulky application of 1 GB source code would consume huge memory. If that is case, you can try to increase your memory arguments.



      2) Bad Code: Bad code, which consumes useless memory, and does not release it later, causes more heap size to be used continously than the garbage collected. If that is the code you might need to identify the issue with your code. You can actually identify the method or class that is consuming this huge amount of heap, using Java Flight Record (JFR).



      Ideal Heap Memory Size varies from from case to case and your requirements must be known for exact heap size.






      share|improve this answer




























        3












        3








        3







        Out of memory error is caused, because the heap size consumed by your code is more than what is allocated by Java.



        This could be because of multiple reasons.



        1) Your code is bulky and needs more memory: A simple code to just print "Hello World" won't consume much memory. However, a lengthy and bulky application of 1 GB source code would consume huge memory. If that is case, you can try to increase your memory arguments.



        2) Bad Code: Bad code, which consumes useless memory, and does not release it later, causes more heap size to be used continously than the garbage collected. If that is the code you might need to identify the issue with your code. You can actually identify the method or class that is consuming this huge amount of heap, using Java Flight Record (JFR).



        Ideal Heap Memory Size varies from from case to case and your requirements must be known for exact heap size.






        share|improve this answer















        Out of memory error is caused, because the heap size consumed by your code is more than what is allocated by Java.



        This could be because of multiple reasons.



        1) Your code is bulky and needs more memory: A simple code to just print "Hello World" won't consume much memory. However, a lengthy and bulky application of 1 GB source code would consume huge memory. If that is case, you can try to increase your memory arguments.



        2) Bad Code: Bad code, which consumes useless memory, and does not release it later, causes more heap size to be used continously than the garbage collected. If that is the code you might need to identify the issue with your code. You can actually identify the method or class that is consuming this huge amount of heap, using Java Flight Record (JFR).



        Ideal Heap Memory Size varies from from case to case and your requirements must be known for exact heap size.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 16 '18 at 7:30









        Basil Bourque

        116k30395559




        116k30395559










        answered Nov 16 '18 at 7:14









        Gautam JainGautam Jain

        334




        334

















            Popular posts from this blog

            The Sandy Post

            Danny Elfman

            Pages that link to "Head v. Amoskeag Manufacturing Co."