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 6011485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:16:00+00:00 2026-05-23T02:16:00+00:00

I am seeing ‘java.lang.OutOfMemoryError: PermGen space’ while running ~300 JUnit tests and using Spring

  • 0

I am seeing ‘java.lang.OutOfMemoryError: PermGen space’ while running ~300 JUnit tests and using Spring context. Having a tough time figuring out what’s eating up PermGen since:

  • in steady state the app consumes about 90m of permgen space
  • I’ve tried -XX:MaxPermSize=256m for unit tests – still running out
  • With -XX:+TraceClassLoading and -XX:+TraceClassUnloading enabled, I see no additional “loading” events while executing the last 20-30 tests before the OutOfMemoryError.

The latter seemingly suggests that something besides Class objects is filling PermGen, no? If so, what could it be? For example, are there circumstances when class instances are stored in PermGen?

Here’s my VM info:

$ java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

related

FWIW, the root of my problem that precipitated this post turned out to be somewhat trivial: I assumed that Maven Surefire plugin inherits VM settings from MAVEN_OPTS (or VM instance running mvn) when it forks a VM – it does not (boo). One has to specify those explicitly using argLine in plugin’s configuration. HTH.

  • 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-05-23T02:16:01+00:00Added an answer on May 23, 2026 at 2:16 am

    Sometimes abuse of String.intern() can cause out of PermGen space errors since interned String instances are stored in PermGen.

    This might be what you are seeing – try eliminating unnecessary String.intern() calls to see if this solves the problem. In general, I wouldn’t recommend using String.intern() unless you are sure that both of the following are true:

    • You are sure that only a limited number of Strings will be added
    • You actually need such Strings to share the same object identity (e.g. if many instances of the same strings would consume unacceptable amounts of memory or you need to rely on == for String comparison for complex performance reasons)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seeing as Java doesn't have nullable types, nor does it have a TryParse(), how
After seeing tons of web site using modal window with a nice expansion animation
I've been seeing more and more websites using fancy antialiased fonts. Every time I
After seeing a friend using RapidWeaver and producing wonderful results in a few clicks,
I'm seeing some strange behaviour with my Rails3 app. Note that I'm using the
I'm often seeing others using a Dictionary object in their AS3 code that simply
Seeing something strange between a Java web service and the .NET client talking to
I've been seeing some strange issues using the Alarm manager in Android, despite the
Seeing that the __RequestVerificationToken is not sent when using AJAX and ValidateAntiForgeryTokenAttribute is looking
Seeing a problem with using form_for with a nested resource where I have remapped

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.