mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
7179383: MaxDirectMemorySize argument parsing is broken for values >2G
Change hotspot flag to be unsigned Reviewed-by: dholmes, sla, fparain, brutisso
This commit is contained in:
parent
135f315eaa
commit
d1080de4ee
3 changed files with 19 additions and 4 deletions
|
@ -345,9 +345,13 @@ JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
|
|||
// Do this after setting user properties to prevent people
|
||||
// from setting the value with a -D option, as requested.
|
||||
{
|
||||
char as_chars[256];
|
||||
jio_snprintf(as_chars, sizeof(as_chars), INTX_FORMAT, MaxDirectMemorySize);
|
||||
PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
|
||||
if (FLAG_IS_DEFAULT(MaxDirectMemorySize)) {
|
||||
PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
|
||||
} else {
|
||||
char as_chars[256];
|
||||
jio_snprintf(as_chars, sizeof(as_chars), UINTX_FORMAT, MaxDirectMemorySize);
|
||||
PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
|
||||
}
|
||||
}
|
||||
|
||||
// JVM monitoring and management support
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue