On Thu, 21 Nov 2024 05:22:46 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> Everything which parses an integer option uses 
>> 
>> DCmdArgument<jlong>
>> 
>>  (e.g. heap dump parallelism, etc...)
>> 
>> 
>> DCmdArgument<jlong>::parse_value(..)
>> 
>> does the parsing, we have never had a definition for
>> 
>> DCmdArgument<jint>
>
> Okay but just to be clear, this change means that the maximum value of this 
> parameter is no longer limited to a 32-bit integer maximum, but is now a 
> 64-bit maximum - the old `parse_integer` function was passed `int` not 
> `jlong`.

As I understand, the "INT" as parsed as jlong in jcmd. It is not limited by 
32-bit. So that's ok. I thought to change max from int to size_t as it done in 
many cases or check if it too big for jint.
However, I doubt that anyone is going to use so huge numbers there. 
The VM.events prints several latest event, remembered by Hotspot. The max 
number is set by LogEventsBufferEntries and is 20 by default and 250 for ZGC. 
The hard-limit is 1*M.
So any value more then LogEventsBufferEntries doesn't limit anything. 
Might be makes sense to treat all values > MAX_INT just as unlimited just in 
case someone made mistake?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22224#discussion_r1851440006

Reply via email to