Increasing Java heap size in Eclipse - using virtual memory

后端 未结 6 1656
伪装坚强ぢ
伪装坚强ぢ 2021-01-16 11:44

I am running a program in Eclipse(Windows) and need a relatively huge size of memory. Passing the -Xmx1500m to the program seems not sufficient, while Eclipse d

相关标签:
6条回答
  • 2021-01-16 11:52

    r u using 32 bit JVM or 64 bit? use 64 bit JVM. I am not sure about the size limitations on 64 bit , but definitely more than 32 bit.

    try this: java -d64 -Xms512m -Xmx60g YourProgram

    it sets 60gb as the max heap size.

    0 讨论(0)
  • 2021-01-16 11:52

    Where you have unzipped the eclipse, look for eclipse.ini in that modify it enter image description here

    0 讨论(0)
  • 2021-01-16 11:56

    I think you need to increase the memory available to eclipse.

    Modify -Xmx option in the eclipse.ini file (in a Windows machine).

    0 讨论(0)
  • 2021-01-16 11:57

    you need to run a 64Bit vm to allow more than around -Xmx1500m

    You may specify that in the Run-Settings for your program and do not need to apply it in the eclipse.ini which is for eclipse itself.

    BUT: it is not a good idea to give the java-vm more memory than the real (physical, free) memory on your system is, because the GC will walk through many areas of the memory when it runs and that will lead to reading/writing memory from/to disk - means swapping. And this again will lead to a very bad performance. In this case you should think about what is consuming the memory and if there is a way to manage this data externally - on disk or some MemoryBuffers.

    0 讨论(0)
  • 2021-01-16 11:57

    You can configure heap size in "Run Configuration Dialog".

    0 讨论(0)
  • 2021-01-16 11:58

    Go to your eclipse root folder where eclipse.exe file is left and you will find eclipse configuration file ( eclipse.ini ) open that file and you need following changesenter image description here

    0 讨论(0)
提交回复
热议问题