Skip to main content

Skip GC regions

2 replies [Last post]
kumsan76
Offline
Joined: 2007-06-12
Points: 0

Hi,
Is there a way to skip some of the regions like S0,S1 form Eden space and directly copy them into the Old Generation region. In our application most of the objects are going to be there in the memory for long time and these are huge objects each of size 2k. Is it possible to avoid copying them into survivor space regoins and push them directly into old gen.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
smoov
Offline
Joined: 2007-05-01
Points: 0

I played with this a few years ago, so this might not be supported in the latest JVMs. I don't recall getting the benefit I was after. Here are my notes, (no doubt copied and pasted from various web sources):

EdenSize = NewSize - ((NewSize / ( SurvivorRatio + 2)) * 2)
SemispaceSize = (NewSize - EdenSize) / 2).

The -XX:MaxTenuringThreshold= option specifies how many collections an object can remain in the young generation, after which it is promoted to the old generation. The promoteall option (last available in 1.2.2) which immediately promoted any object that survived a young generation to old generation space, can be simulated using -XX:MaxTenuringThreshold=0 (in which case there is no need for any semispace, so they should be sized extremely small in conjunction, e.g. -XX:SurvivorRatio=20000).

-XX:SurvivorRatio=20000
-XX:MaxTenuringThreshold=0
-XX:+PrintTenuringDistribution

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

as far as I know not - at least not by source.
Maybe there is an option that objects over a specified size should be allocated to old gen directly, but I don't know about such an option.

What I wonder: How long will your objects be alive, if they go to old-gen? If they live long, don't worry about the copy overhead - if not maybe you should make your eden space larger?

lg Clemens