Alex Rivera | Logout

Does the JVM force garbage collection when it reaches its -Xmx limit?

Asked 2012-02-21T09:31:10.687
12

The question is basically contained in the title.

Say you have an application that has reached its JVM -Xmx limit. When that application requires more memory is garbage collection forced ? (in the HotSpot JVM)

A second odd thing I can't explain is that I currently have an application server which is ran with -Xmx=2048m, the "top" command (on linux) reports 2.7g for its process.

So how/when is an application allowed to exceed its -Xmx ?

Thanks,

Edit
Report

1 Answer

11

Actually the normal GC is triggered when young generation is full (not the whole heap) and major GC is triggered when there is no space left in survivor space so some objects need to be migrated to old generation.

answered 2012-02-21T09:43:12.627

Your Answer