What is Java PermGen garbage collector?

List of garbage collectors:

  • Serial GC
  • Parallel gc
  • Parallel Old GC
  • Conc Mark Sweep GC
  • G1 GC

I know that Conc Mark Sweep GC supports PermGen cleanup when you enable the ClassUnloading JVM option. Do other garbage collectors support PermGen cleanup?

Reason: we use Spring, Hibernate and Groovy, which create a lot of Proxies, and Perm Gen is getting big.

Edit: I must mention that I am using Java 7. I know that Java 8 removes Perm Gen and hopefully updates sometime in the future. In the meantime, my question is whether other garbage collectors support PermGen cleanup besides Conc Mark Sweep.

  • Serial GC
  • Parallel GC (Believe-server uses this by default and confirmed that it clears perm gen)
  • Parallel Old GC
  • Conc Mark Sweep GC (you can clear perm gen with the JVM flag)
  • G1 GC
+5
source share
1 answer

All algorithms clear PermGen, but

  • not every GC cycle includes PermGen cleanup.
  • CMS can clear PermGen at the same time , G1 requires stop-the-world Full GC to unload classes (pure PermGen) to Java 8u40
  • Java 8 has meta-pass, not PermGen, but it must also be garbage-collected (otherwise you will get OOME in the meta definition)

I struggle a lot with OOME in PermGen when I actively used ClassLoaders to simulate multiple JVMs in the same process for testing. My conclusion: PermGen GC is just not very reliable. One run works as expected, the other it throws OOEM.

+3
source

Source: https://habr.com/ru/post/1213062/


All Articles