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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:43:40+00:00 2026-06-04T05:43:40+00:00

For Sun/Oracle’s JVM, I’ve read that the GC algo divides new generation into one

  • 0

For Sun/Oracle’s JVM, I’ve read that the GC algo divides new generation into one Eden region and two survivor regions. What I’m wondering about is, why two survivor regions and not just one? The algo can keep ping-ponging between Eden and just one survivor region (the way it currently does between two survivor regions); or are there any shortcomings to this approach?

  • 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-04T05:43:42+00:00Added an answer on June 4, 2026 at 5:43 am

    I believe JRockit’s GC implementation works more like you suggest, with just a single eden and single survivor space, but don’t quote me on that.

    The reason for the HotSpot JVM’s two survivor spaces is to reduce the need to deal with fragmentation. New objects are allocated in eden space. All well and good. When that’s full, you need a GC, so kill stale objects and move live ones to a survivor space, where they can mature for a while before being promoted to the old generation. Still good so far. The next time we run out of eden space, though, we have a conundrum. The next GC comes along and clears out some space in both eden and our survivor space, but the spaces aren’t contiguous. So is it better to

    1. Try to fit the survivors from eden into the holes in the survivor space that were cleared by the GC?
    2. Shift all the objects in the survivor space down to eliminate the fragmentation, and then move the survivors into it?
    3. Just say “screw it, we’re moving everything around anyway,” and copy all of the survivors from both spaces into a completely separate space–the second survivor space–thus leaving you with a clean eden and survivor space where you can repeat the sequence on the next GC?

    Sun’s answer to the question is obvious.

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

Sidebar

Related Questions

On a page of Java's Bug Database https://bugs.java.com/bugdatabase/view_bug?bug_id=4508058 it reads that Sun/Oracle will not
Aside from Websphere, the Sun/Oracle JVM seems to be near-ubiquitous. Do people have much
The official Sun Oracle stance on Thread.stop() is that it should not be used.
I am getting PermGen space error on Sun JVM (1.6.0_21-b06) (Ok, it's Oracle :)).
Im' running this code on a Linux Red Hat with the sun/oracle JVM 1.6_23,
I am downloading Sun/Oracle Mojarra implementation of JSF from http://javaserverfaces.java.net/download.html I downloaded the latest
I read in Sun official documentation (or Sun online tutorial) about dotted naming for
With the merger of SUN and Oracle: What is the future of Open ESB
Since Oracle took over Sun... this specific resource has apparently vanished. I tried the
Yesterday Oracle decided to take down java.sun.com for a while. This screwed things up

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.