RFR(S, testonly): JDK-8072835 sun/tools/jmap/heapconfig/JMapHeapConfigTest.java Key MaxHeapSize doesn't match

Dmitry Samersoff dmitry.samersoff at oracle.com
Tue Feb 10 20:07:31 UTC 2015


Staffan,

Changed in-place (press shift-reload)

-Dmitry

On 2015-02-10 22:59, Staffan Larsen wrote:
> 
>> On 10 feb 2015, at 20:52, Dmitry Samersoff <dmitry.samersoff at oracle.com> wrote:
>>
>> Staffan,
>>
>>> I don’t think you need to respect -Xmx if it set from outside.
>>
>> Embedded systems can have special requirements like 2mb heap that is not
>> possible to set on a big machine.
> 
> That is a good point. Leave the logic you have in there, but change the loop to:
> 
>        List<String> jvmOptions = Utils.getVmOptions();
>        for (String option : jvmOptions) {
>            if (option.startsWith("-Xmx")) {
>                System.out.println("INFO: maximum heap size set by JTREG as " + option);
>                mx_found = true;
>                break;
>            }
>        }
> 
> /S
> 
>>
>> If it is not the case - I'll change the code to use
>> Utils.getFilteredTestJavaOpts()
>>
>> -Dmitry
>>
>> On 2015-02-10 22:45, Staffan Larsen wrote:
>>> I don’t think you need to respect -Xmx if it set from outside. We
>>> know that this test is not testing -Xmx, it is just using that flag
>>> to check that jmap works. You can override the value of -Xmx in two
>>> ways: 1) either set your value before or after the other value (I
>>> don’t know which value takes precedence) so that your value is the
>>> one that is used, or 2) use Utils.getFilteredTestJavaOpts() to remove
>>> any -Xmx flags from the VM options before adding yours.
>>>
>>> desiredMaxHeapSize should say “-Xmx128” not “-Xms128”.
>>>
>>> /Staffan
>>>
>>>> On 10 feb 2015, at 16:39, Dmitry Samersoff
>>>> <dmitry.samersoff at oracle.com> wrote:
>>>>
>>>> Hi Everyone,
>>>>
>>>> Please review the changes:
>>>>
>>>> http://cr.openjdk.java.net/~dsamersoff/JDK-8072835/webrev.01/
>>>>
>>>> if maximum heap size is not specified explicitly JVM might change
>>>> this value and it wouldn't match one printed on start.
>>>>
>>>> The fix makes sure that LingeredApp starts with -Xmx option.
>>>>
>>>> -Dmitry
>>>>
>>>> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg,
>>>> Russia * I would love to change the world, but they won't give me
>>>> the sources.
>>>
>>
>>
>> -- 
>> Dmitry Samersoff
>> Oracle Java development team, Saint Petersburg, Russia
>> * I would love to change the world, but they won't give me the sources.
> 


-- 
Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.


More information about the serviceability-dev mailing list