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.

0 Likes

#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 Likes

#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.

0 Likes

#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?

0 Likes

#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

0 Likes

#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?

0 Likes

#7

I just started getting this error. Only thing I did was download the OpenJDK 11.0.1+13 from the adoptopenjdk.net site, unzip and point Tomcat to it. The stderr log fills up wit this error without ever even hitting Lucee.

I’d already been using Tomcat 9.0.12 and OpenJDK 11.0.1 GA from https://jdk.java.net/11/ on several other machines without trouble.

The only difference is that the machine having issues is a 32b Windows machine, the others are 64b Windows machines. AdoptOpenJDK has a Windows 32b version and other sites do not.

I am running Lucee 5.3.2.17-SNAPSHOT (not updated beyond that due to this issue:
https://groups.google.com/forum/#!topic/coldbox/DVFQTvm9sVc)

When upgrading Lucee to any SNAPSHOT above Lucee 5.3.2.17-SNAPSHOT, our site gets this error:
Type: java.io.IOException Messages: org.osgi.framework.BundleException:Bundle symbolic name and version are not unique: TOMCAT_9_0_12:0.0.0

0 Likes

#8

Is anybody else seeing this with OpenJDK 11.0.1+13?

0 Likes

#9

Gotta admit, I’m really surprised to see this. Any particular reason you’re still running 32b here? Supporting an additional bit type is a lot of work, there’s very little demand for it, and there’s no Adopt 32b Java 11 build for Linux. Due to these factors, I just stopped doing 32b builds for the installers.

Are you using ancient hardware or software that still requires 32b? Would be interested to know your reasons for continuing to run 32b in your environments.

0 Likes

#10

The current Lucee 5.3 installer builds are also running Tomcat 9 and Adopt Java 11. They passed my initial tests, but we haven’t used them too much yet in production environments. That said, we haven’t had issues with them either. My guess is that your issue is related to your 32b system or JRE.

0 Likes

#11

Thanks Jordan. The production servers are all 64-bit machines, so there’s no problem there. However, the company’s dev workstations are all 32b as the company’s CRM, ERP, etc. software are ancient DOS-based FoxPro applications. There’s no way to get off of the FoxPro app.

The irony is it’s a computer hardware manufacturer, so all hardware is beyond state of the art. The PC used by the average secretary for email could probably run a small 3rd world country! We are in the heart of Silicon Valley and you would be absolutely amazed at how many big tech hardware companies (all whose names you know quite well!) are running DOS-based software applications!

Anyways, there’re plenty of workarounds such as having separate dev workstations, etc. but I was trying to understand why this might be happening?

0 Likes

#12

Just to be clear, is this message in the logs actually causing you issues or are you just trying to remove it? The message

Free Perm Gen Space is less than 5% free: shrinking all template classloaders : consider increasing allocated Perm Gen Space

is really more of a warning than an error, and if you’re on Java 8+ plus you don’t even have a perm gen space so you can probably just ignore it. Analyze your memory spaces and if they are healthy (especially you rmetaspace) then I wouldn’t worry about it warning.

0 Likes

#13

I haven’t noticed a specific issue other than crashing Notepad++ when trying to load the std err log due to its size! That error fills up continuously for nearly a million lines.

The issue is that the tomcat9-stderr.2019-01-02.log (so created 5 days ago) is at 135MB on a machine where the Tomcat service is running, but no apps, etc. are hitting it, so it just seems to grow non-stop?

You said the error comes from Lucee itself, so is there a way to turn off that warning?

0 Likes

#14

Yes, log files of that size does seem like an issue. Looking at the logic, there does not appear to be any way you can disable the setting. There is a permGenCleanUpThreshold that starts at 60 but regardless of what you set it to, Luee will slowly decrease it by 5 until it reaches 5 at which point your message begins appearing in the logs. The output also bypasses any log4j settings which would allow you to disable the logging of the message because it prints directly to the system.out.

I think your only recourse is to lobby for the tiket I posted above to get fixed. I am curious however if you do have a memory space that is running low and which on it is. it appears if you don’t have a memory space with a name that looks like perm gen, Lucee simply grabs the first non-heap space it can find and if that fails, it grabs any memory bean called “Class memory”.

0 Likes

#15

Voted.

0 Likes

#16

On a related note, here is the ticket for Adopt to start providing LInux 32 bit builds for their OpenJDK builds. Freel free to vote on it if 32 bit Linux is a need for you.

2 Likes

#17

@Leftbower I almost forgot-- I searched the Lucee JIRA yesterday and I couldn’t find a ticket for this error:

When upgrading Lucee to any SNAPSHOT above Lucee 5.3.2.17-SNAPSHOT, our site gets this error:
Type: java.io.IOException Messages: org.osgi.framework.BundleException:Bundle symbolic name and version are not unique: TOMCAT_9_0_12:0.0.0

@micstriit 's rule is if a bug isn’t in JIRA, it doesn’t exist :slight_smile: And he doesn’t read every post here so he possibly doesn’t even know about it. Can you enter a ticket?

0 Likes

#18

lol

It’s interesting reading some of the comments in that thread. If there’s still a healthy demand for the 32b builds, I’m okay with continuing to build and test 32b installers. I just didn’t want to invest the time if it wasn’t an actual need there.

0 Likes

#19

I will do this when I get in and link it here.

1 Like

#20

Bug filed: LDEV-2132

1 Like