Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9251171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:37:48+00:00 2026-06-18T10:37:48+00:00

I know this has probably been asked many times before, but I still haven’t

  • 0

I know this has probably been asked many times before, but I still haven’t seen an actual fix for it.

My day-to-day development environment is as follows:
1. NetBeans (latest), 2. Glassfish (latest as bundled with NB), 3. JPA, JSF, JAXB, Jersey for JAX-RS

I have about 600 classes in my project, spread across two EJB projects and one WAR project, all inside an EAR.

I am on latest JDK 7 (on OS X) and I am on an hourly basis getting the infamous “PermGen space” bug. Let’s say if I am doing 3 incremental re-deploys a minute, I can only work for a short while before either:

  • Glassfish run out of PermGen space, so I just have to kill the process.
  • Deployment becomes extremely slow, due to me having increase max permgen space (as one is advised to do from dozens of answers on S.O.)

Often the only solution is to kill glassfish every 30 minute or so. It’s definitely due to a bug somewhere that simply loads new classes for every new incremental re-deploy instead of getting rid of the old ones. I thought this was supposed to be fixed in JDK 7?

This has been a long standing bug in the kind of development environment, and I am rather shocked that it’s still going on after my 5+ years of Java development. It’s just so frustrating and incredibly unproductive.

(Just before anyone suggests increasing permgen space, believe me I’ve tried that, and the only thing it “solves” is to prolong the inevitable. I’ve seen redeployments take up to 400 seconds at its worst. Redeployment is supposed to take 5-6 seconds for a project this size, no more.)

EDIT: I ran jmap and jhat on the Glassfish process after the following steps:

  1. Start glassfish
  2. Deploy my EA
  3. Undeploy my EA
  4. Then did a heap dump with jmap

It turns out that all my classes (which should have been unloaded) are still loaded! Hopefully this is useful information to someone reading this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:37:49+00:00Added an answer on June 18, 2026 at 10:37 am

    Surely, that is a bug, and I don’t think that there is an easy solution for that. (If there were, probably you have had it already).

    What you can try: Use some hot code replacement tool for example JRebel, This way you don’t have to deploy all the time, instead this tool watches the changes of the .class files (and even other web resources, if you configure so), and replaces the class definition within the running JVM. Sounds cool, right?

    It works as a Java agent, it starts when your JVM starts.

    There are 3 drawbacks of this solution: The deployment is a bit slower, it’s harder to debug, and it’s a proprietary software (but does not cost much)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has probably been asked so many times here, but I
I know this has probably been asked before but for my problem I cannot
I know this probably has been asked before but I am having issues with
I know this has been asked probably a thousand times, but I've been biting
I know this has probably been asked a million times but I can't find
I know this has probably been asked before, but I can't find it with
I know this has probably been asked 100 times, but I don't know the
I know this has probably been asked a million times, but how do I
I know this has probably been asked before but I can't find a specific
I know this has been asked a few times before, but there has been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.