3

So I've got a pretty standard spring, hibernate, tomcat environment.. yet I'm getting permgens locally and on CI.

I know there is a TEMPORARY fix (i.e. increasing the memory assigned to permgen) but this still is only temporary. I'd rather not imagine what a production environment looks like given what I'm seeing.

(a bit of a comparison question) In .NET I have not seen anything similar. Does .NET have its version of permgen?

(in case you do not know what permgen is Significance of PermGen Space )

Community
  • 1
  • 1
user48545
  • 3,291
  • 9
  • 31
  • 42

2 Answers2

3

There is no such thing in the CLR. Just a ordinary heap. The garbage collector (GC) is generational, with three generations. One for young objects, one for long living and one for very long living objects. There is also a lage object heap (LOH). The GC treats the LOH a bit differently in order to increase efficiency. See Large Object Heap Uncovered

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188
  • What about for interned strings? Are those not effectively "permgen"? – user2864740 Feb 23 '17 at 05:44
  • Interning is done for string literals (i.e. strings visible as plain text in the source code), but not for strings created dynamically at runtime. You cannot use it as a general memory management system. – Olivier Jacot-Descombes Feb 23 '17 at 15:10
1

No, the CLR (C# is "just" a CLR language) does not have a permanent generation, see Fundamentals of Garbage Collection.

Btw, future versions of the JVM - currently expected at the latest for Java 8 - won't have permgen either (see Oracle discusses Java 7 & 8 new features on video) (basically as a result of "merging" the "classic" Sun HotSpot VM that has permgen and JRockit JVM).

jeha
  • 10,562
  • 5
  • 50
  • 69