Hibernate - java.lang.OutOfMemoryError: Java heap space

前端 未结 3 603
别那么骄傲
别那么骄傲 2021-01-27 09:17

I get this exception:

Exception in thread \"AWT-EventQueue-0\" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    a         


        
3条回答
  •  孤独总比滥情好
    2021-01-27 09:37

    While such an error might be an indicator for a memory leak, it could also just result from high memory usage in your program.

    You could try to amend it by adding the following parameter to your command line (which will increase the maximum heap size; adapt the 512m according to your needs):

    java -Xmx512m yourprog
    

    If it goes away that way, your program probably just needed more than the default size (which depends on the platform); if it comes again (probably a little later in time), you have a memory leak somewhere.

提交回复
热议问题