Hello Lorenzo!
Warm welcome to the Italian boy from the beautiful wine & dine country!!
In order to diagnose 'OutOfMemoryError: GC overhead limit exceeded' - we need to study the Garbage Collection log file first and not thread dump. Thread dump might not be helpful in this case.
When your application experiences 'OutOfMemoryError: GC overhead limit exceeded' it means you are having either one of the problem:
a. Your application needs more memory than what you have allocated
b. Your application has memory leak.
Let's discuss them below:
a. Your application needs more memory than what you have allocated:
Is this 'OutOfMemoryError: GC overhead limit exceeded' happening during peak volume time period? Or are you running Batch processes around this time? May be your application traffic volume has grown. More traffic translates to more memory consumption. Thus you might need to allocate more memory to your application than what you have allocated. Try increasing your -Xmx and see whether this problem goes away.
b. Your application has memory leak
If your application has memory leak then also this problem can surface. Did you make any recent code deployment? Did the
'OutOfMemoryError: GC overhead limit exceeded' started surfacing after that? Here is a video clip that walks you through how to diagnose memory leak: https://www.youtube.com/watch?v=SuguH8YBl5g&t=21s
I would first try #a (i.e. increase memory) and see whether this problem goes away. I would also highly recommend you to read this memory pattern blog post.
Edit your Comment