Perm Gen Space


#1

anyone have error message like this? my app is very slowly :disappointed_relieved:

2017-11-27 15:14:24.801  Free Perm Gen Space is less than 5% free: shrinking all template classloaders : consider increasing allocated Perm Gen Space

i have already set memory on tomcat/bin/setenv.sh

#! /bin/sh

export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx6024m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=1024m"

my physically memory is 8GB, my server is ppc64 using rhel and i install lucee using 5.2.3.35.war.


#2

Firstly, is there a reason you’re not on Java 8 yet? As for your error messages, sounds like something is loading Java classes over and over again.

For starters are you using Javaloader? Always always always make sure you cache your javaloader instance in the server scope and don’t recreate it. The next thing is are you using TestBox with heavy mocking/stubbing or WireBox AOP on transients. Either of those can sometimes create a large number of new class files due to the way they create .cfm templates and cfinclude them on the fly.

And finally, use a tool like FusionReactor to monitor your permgen space and see if the jumps correspond with any particular scheduled tasks or jobs on your server.


#3

Firstly, is there a reason you’re not on Java 8 yet? As for your error messages, sounds like something is loading Java classes over and over again.

i’m using ibm-java-sdk-8.0-5.5-ppc-archive.bin

For starters are you using Javaloader? Always always always make sure you cache your javaloader instance in the server scope and don’t recreate it. The next thing is are you using TestBox with heavy mocking/stubbing or WireBox AOP on transients. Either of those can sometimes create a large number of new class files due to the way they create .cfm templates and cfinclude them on the fly.

I don’t know how to configure it. Can you give me sample, please…

And finally, use a tool like FusionReactor to monitor your permgen space and see if the jumps correspond with any particular scheduled tasks or jobs on your server.

ok, i’ll try to use this tool.


#4

i’m using ibm-java-sdk-8.0-5.5-ppc-archive.bin

You may have that installed, but I’m pretty sure you wouldn’t be getting any logging related to perm gen space if you were on Java 8… Dump out the server scope in your app to confirm what version of java is being used.

I don’t know how to configure it. Can you give me sample, please…

Configure what? I listed 3 different libraries. Are you using any of those libraries?


#5

This is my java information:
java_ibm

For library i’m using cfspreadsheet with inspect Once and for coding i’m never using Javaloder.

This log always show up until now, i don’t know what wrong with my lucee config

2017-11-27 15:14:24.801 Free Perm Gen Space is less than 5% free: shrinking all template classloaders : consider increasing allocated Perm Gen Space


#6

Ahh, I found where that error is coming from. It’s coming from Lucee itself, not the JVM which explains a lot. You have no perm gen space at all, but Lucee hasn’t been adjusted fully for Java 8 and it still has a permgen check in place. I’m honestly a little curious what the heck it’s measuring on your Java 8 system. From the looks of the SystemUtil class, it’s looking over a bunch of MemoryPoolMXBean classes for one that has a specific name in the title.

I put in this ticket:
https://luceeserver.atlassian.net/browse/LDEV-1598

What does FusionReactor show for your memory spaces?