java - Is the PermGen space ever decreased? -


i know if jvm unloads classes in order decrease permgen space. here questions:

  1. do java classes ever unloaded default jvm?
  2. does closing jar classloader unloads loaded classes jar?
  3. what commands/ways should used allow unloading of classes?

fyi, did try of solutions on web none of them answered questions. (for example: what jvm flag cmsclassunloadingenabled do?)

ps: referring java 6 + hibernate (the class loading handled hibernate)

hibernate loads entity classes in memory when sessionfactory starts. on other hand entity istances loaded hibernate in lazy way, when needed.

classes can unloaded gc when jvm needs memory. entity istances garbage collected but, other object, when there no more references pointing @ them. in other words entity istances cannot unloaded if hibernate session still open. unload them need clear persistence context or close session.


Comments