-1

I am facing

Out of memory error in java heap space

I am using glassfish server for deployment of my maven based application, and Java JDK is 1.7. I have configured my glassfish server domain.xml as MaxPermSize is 512M and Xmx is 1024M , as mentioned in snap 1, I am confused because my glassfish not utilizing complete 1GB of heap size as it having , its just consumed max heap 300m but its through above error and stooped everything. how can I resolve this issue? its occurs two times a day.

enter image description here

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

-XX:NewRatio=2 means that:

old generation size : young generation size = 2:1

So the young generation size is 1024/3 = 341M. It means that:

Eden size + 2*Survivor = 341M

The Eden size is about 300M.

You should set Xmx bigger.

flycash
  • 414
  • 4
  • 8