How much memory a program takes up when running has nothing to do with the amount of your code. It has something to do with how your code is written. A few lines of code can also cause the memory to explode. To analyze the memory usage, just dump the heap memory and see if The program has always maintained 7,800M of memory, indicating that there is no memory leak or other problem.
How much memory a program takes up when running has nothing to do with the amount of your code. It has something to do with how your code is written. A few lines of code can also cause the memory to explode. To analyze the memory usage, just dump the heap memory and see if The program has always maintained 7,800M of memory, indicating that there is no memory leak or other problem.
Use jmap -histo your pid to see where a lot of memory is occupied
Have you set the heap size? These are the parameters Xmx Xms