Issue: while deploying application we are start getting permgen error very frequently
Root cause of OOM on perm gen when deploying an application:
Interned java.lang.String objects are also stored in the permanent generation. The java.lang.String class maintains a pool of strings. When the intern method is invoked, the method checks the pool to see if an equal string is already in the pool. If there is, then the intern method returns it; otherwise it adds the string to the pool. In more precise terms, the java.lang.String.intern method is used to obtain the canonical representation of the string; the result is a reference to the same class instance that would be returned if that string appeared as a literal. If an application interns a huge number of strings, the permanent generation might need to be increased from its default setting.
When this kind of error occurs, the text String.intern or ClassLoader.defineClass might appear near the top of the stack trace that is printed. This is the key here as all OOM are throwing messages of this kind.
Solution: Increase perm gen size to a much greater number, let's say 1024m and test.
No comments:
Post a Comment