Reputation: 329
Can anyone shed some light on why the heap space gets to maximum and purges immediately afterwards ?
Upvotes: 0
Views: 137
Reputation: 448
In JVM, the memory is managed with several generations: depending on the time an object is being used, it might be promoted and moved from a young to an older generation or it might be purged if it is not used anymore.
When you see small purges of heap, it means that only objets in young generation are being purged. When you see huge purge of heap, it means that the garbage collector did a full job and also cleaned old generations. The GC decides to make a full work when the global heap size approaches its maximum size.
Upvotes: 1