« Free Seminar - Introduction to ADF | Main | Looking for JDeveloper and ADF Sessions for OOW 2009 »

Solving PermGem Errors with the Integrated WLS in JDeveloper

One bug that we are aware of in JDeveloper 11g is that there is a memory leak if you do many repeat runs of an application.

However there is an easy way to eliminate most of those by changing the a setting in the specs for the integrated server.

Locate the file: setDomainEnv.cmd which should be at:
[JDev Install Dir]\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\bin

There find the line:
set MEM_MAX_PERM_SIZE=-XX:MaxPermSize=128m
and change it to:
set MEM_MAX_PERM_SIZE=-XX:MaxPermSize=512m

Now try and run your projects again.

Comments (12)

John Stegeman:

And, of course, on Unix/Linux, the file to edit is setDomainEnv.sh

jlavric:

Hi!
I have external WLS server and I'm deploying my applications to that external server. And it happens there too. After three or maybe four deployments I get PermGen Error.

Server settings are
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m
.
WLS Start Mode=Development

I will change this, I just wanted to say that maybe this error is not JDevelopers deployment process issue.

ADF on!
Janez

Darragh Duffy:

Shay thanks for this - it solved my problem - it was getting very annoying but this setting seems to have done the trick.

Darragh

Pavel:

I used such settings before, but it seems the solution for me was to clean "drs" directory if application runs to slow or cached previous deployment.

MEM_MAX_PERM_SIZE=-XX:MaxPermSize=512m i think is to much for Perm memmory - even for big applications.

Probably the problem is not in this settings.

Jerome:

drs directory is the deployment dir of weblogic and has NOTHING to do with mem. You clean drs to remove old redeployments.

512MB might be too much but this is cos weblogic has a mem leak. So eventually you will run out of mem. So, the > the permsize the > the time you get with no out of mem error.

Savvy?

PS: Yes the problem is in the mem leak if that is what you mean, but untill then that is a damn good workaround.


Andre:

It got better when configuring these settings, but I still get PermGen error after like 10 runs of my application. Before I configured WLS, it happened about every 3rd time I run the app. Anything else I could do to get rid of this completely?

thanks

spido:

There is a limitation on the total mem that a java app can have under windows 32bit. This is something from the net:
Win32 (Win2K, XP, 2K3): roughly 1300m (+/- 100m)
Linux (2.6 kernels): safe upto about 2500m; higher if you dare
Solaris 8 and 9: ~ 3000m (but you can push it up to 3500m sometimes)
(http://forums.sun.com/thread.jspa?threadID=765037)

In order to use 512MB as perm mem, you cannot increase xmx much more than 768MB.

So far I tested perm mem = 256MB and xmx=1024, and when I got perm mem out of exception, the mem used by java process of weblogic was 621MB.

Conclusively, I think that there is a trade off between max perm mem and max xmx.

I am using perm mem=512MB & xmx=768MB now and so far everything's OK

Anonymous:

Shay, perhaps you should consider pointing out that if users deploy to a WLS instance that is running the JRockit JVM, then PermGen errors do not happen at all as it's garbarge collection mechanisms are different than Sun's.

James

John Stegeman:

@James, I actually just posted about this on the JDeveloper forums and showed an approach for how to set up your development environment to use JRockit for running the integrated WLS: http://forums.oracle.com/forums/thread.jspa?threadID=879103

John

Ahmed Elhamy:

Thanks for all of you, This solved the perm Gen space memory problem

spido:

As far as we 're talking about mem problems, you know this
http://andrejusb.blogspot.com/2009/06/jdeveloper-11g-ide-performance-problem.html
but
also here as some trivial solutions until oracle fixs this bug
http://developers2developers.blogspot.com/

spido:

And this is how is done in WLS 10.3.1

http://developers2developers.blogspot.com/

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)