Request for review - 8011268: NPG: Free unused VirtualSpaceNodes
Jon Masamitsu
jon.masamitsu at oracle.com
Sat Apr 6 16:21:56 UTC 2013
On 4/4/2013 9:07 PM, Jon Masamitsu wrote:
> ...
>
>>
>> You are not decreasing the _container_count when returning humongous
>> chunks in ~SpaceManager:
>> 2123 Metachunk* next_humongous_chunks = humongous_chunks->next();
>> // here you could do a
>> humongous_chunks->container()->dec_container_count();
>> 2124
>> chunk_manager->humongous_dictionary()->return_chunk(humongous_chunks);
>>
>> You are already incrementing _container_count for humongous chunks
>> allocated from the hum chunk free list because those allocations go
>> through the chunk_freelist_allocate wrapper function you added.
>
> A VirtualSpace that contains 1 Metachunk holds nothing else so that
> decrementing
> the count on such a VirtualSpace will deallocate it. I'll try it but
> may revert it.
>
>
My statement above is wrong. A VirtualSpace can hold more than 1
humongous block.
Jon
>>
>> It also feels strange that inc_container_count() is private but
>> dec_container_count and container_count() are public. I realize that
>> it works currently because VirtualSpaceList is a friend of
>> VirtualSpaceNode but it seems like a strange level of encapsulation.
>
> Isn't incrementing the counter done by a VirtualSpaceNode
> and decrementing done by a SpaceManager for the dec_container_count()
> needs to be public?
>>
>>
>> The class space only contains one VirtualSpaceNode currently, should
>> we add some code to make sure that we don't accidentally free that
>> memory?
>
> Let me defer this because I think Coleen had something to say.
>
> Thanks.
>
> Jon
>>
>> /Mikael
>>
>>>
>>> http://cr.openjdk.java.net/~jmasa/8011268/webrev.00/
>>>
>>> Thanks.
>>>
>>> Jon
>
More information about the hotspot-gc-dev
mailing list