RFR(S): 8040920: Uninitialised memory in hotspot/src/share/vm/code/dependencies.cpp

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Apr 30 21:55:39 UTC 2014


On 4/30/14 2:35 PM, Christian Thalinger wrote:
>
> On Apr 30, 2014, at 11:26 AM, Vladimir Kozlov <vladimir.kozlov at oracle.com> wrote:
>
>> Morris,
>>
>> How you verified that you put ResourceMark in all needed places?
>> That is what I don't like about GrowableArray.
>
> He could put a ResourceMark in front of every GrowableArray.  That would do it.

Nested ResourceMark has bad effect on external GrowableArray: if it 
grows after inner ResourceMark that space will be released after inner 
scope ends. You will get memory stomps because of that. You need to be 
sure that external GrowableArray never grows inside inner ResourceMark 
scope.

Vladimir

>
>>
>> Thanks,
>> Vladimir
>>
>> On 4/30/14 11:47 AM, Morris Meyer wrote:
>>> Vladimir and Christian,
>>>
>>> Thank you for the reviews.
>>>
>>> This version has your comments incorporated and has been put through
>>> JPRT and passes Parfait cleanly.
>>>
>>>          --mm
>>>
>>> JBS - https://bugs.openjdk.java.net/browse/JDK-8040920
>>> WEBREV - http://cr.openjdk.java.net/~morris/JDK-8040920.05
>>>
>>>
>>> On 4/24/14, 2:16 PM, Vladimir Kozlov wrote:
>>>> Using GrowableArray requires adding ResourceMark otherwise it will be
>>>> memory leak. Method clear() does not free resources.
>>>>
>>>> Vladimir
>>>>
>>>> On 4/24/14 9:30 AM, Morris Meyer wrote:
>>>>> Folks,
>>>>>
>>>>> Could I get a review for this parfait issue?  I've refactored
>>>>> dependencies to use a GrowableArray to protect from inconsistencies in
>>>>> passed in argument pairs (int nargs, DepArgument args[])
>>>>>
>>>>> Thanks to Christian Thalinger and Vladimir Kozlov for looking at earlier
>>>>> versions of this.
>>>>>
>>>>>          --morris
>>>>>
>>>>> JBS - https://bugs.openjdk.java.net/browse/JDK-8040920
>>>>> WEBREV - http://cr.openjdk.java.net/~morris/JDK-8040920.04
>>>>>
>>>
>


More information about the hotspot-compiler-dev mailing list