Re: [rvm-research] How to record objects' read/write times
Robin Garner <[email protected]>
| Newsgroups | gmane.comp.java.jikes.rvm.devel |
|---|---|
| Message-ID | <[email protected]> |
On 01/06/15 19:51, 王晨曦 wrote:
> Hi ,robin
>
> I have checked the function collectionRequired() in Gen.java again,
> I think I understand the nursery's initial size.(The question 1))
>
> The function virtualMemoryExhausted() can control the initial size of nursery.
>
> private boolean virtualMemoryExhausted() {
> return ((int)(getCollectionReserve() * WORST_CASE_COPY_EXPANSION))
>> = getMaturePhysicalPagesAvail();
> }
>
> WORST_CASE_COPY_EXPANSION = 1.5f
>
> So,I think in the begin ,the ratio of nursery / immix can't exceed
> 1/1.5 ; Or It will trigger a minor GC.
> So,I guess the initial nursery size is less than 1/2.5 (40%) of the
> initial heap.(The initial heap size is 50M, I have seen.)
> May be other space occupy some heap, so the initial nursery size is 16M.
>
> Is this right?
I haven't checked your calculation, but yes - this is what's going on:
MMTk makes judgements about when to collect based on the status of the
entire heap (of which the nursery is a part), not just on the size of
the nursery.
The virtualMemoryExhausted() check catches an edge case where the size
of the heap gets close to the virtual address space available for the
mature space - in a 50m heap it's not going to come into play.
So if the bounded nursery is 32M and the heap is only 50M, the nursery
can never reach 32M - it will get to 50/3 at most. If you increase the
heap size (-Xms200m for example), the nursery will reach its bound for
many collections, until the mature space makes it impossible.
> On Sun, May 31, 2015 at 6:44 PM, 王晨曦 <[email protected]> wrote:
>> Hi,Robin
>>
>> Thank you for your help very much!! I have confirmed what you have
>> said. I can get most of them.
>> But I still have some doubts that I can't understand.
>>
>>
>>>
>>>> 1)
>>>> So,my first doubt is I can't find which variable to describe the
>>>> "the nursery size is set to 1/2 the available heap size ".
>>>> I mean the program set which variable to control this ?
>>>> May be the nursery size is set as the min of the range
>>>> (fixedNursery.value) ,and round to the max size (boundedNursery.value)
>>>> when the program is running ?
>>>
>>> Look at the method Plan#getPagesReserved().
>>
>> 1)
>> I have read this function, I think this function is about to get the
>> current reserved pages. I can't find its connection with the Nursery's
>> initial size in GenImmix.
>>
>> But I really have seen that the nursery's initial size is 16M, half of
>> the nursery's max size( default max size is 32M).
>>
>>
>>>
>>> No, all spaces dynamically resize, but they don't change their virtual
>>> memory. When we use a nursery in high memory, the base virtual address
>>> of the nursery is fixed at build time. When we talk about "resizing"
>>> spaces, we simply mean using more or less of the space that has been set
>>> aside.
>>>
>>
>> 2)
>> I have read the functions about how to manage the nursery space
>> (GenImmix config).
>> In my opinion ,The nursery is a MonotonePageResource , and the nursery
>> space is allocated in the top of the heap.
>> But,when allocate pages ,the nursery's allocator will start from the
>> nursery's low address ( Monotone.cursor / nursery.start ) to the heap
>> end ( Monotone.sentinel ).
>> And the nursery's virtual memory will not be occupied by other
>> discontiguous space,even if the nursery only use little of it.
>>
>> Are these right?
Exactly. The overall heap layout looks something like
|<- VM ->| |<------ Discontiguous spaces---->|<- Nursery->|
unless you enable discontiguous nursery spaces.
>>
>>
>> Than you !
>>
>>
>> --
>> ChenXi.Wang
>
>
>
------------------------------------------------------------------------------
_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers