1. Gather information on the default JVM maximum heap size settings for Java 1.8+
2. Base on the information in 1, determine if we can drop the -Xmx JVM startup parameter
|
73 KB
|
891 KB
|
34 KB
|
125 KB
|
32 KB
|
84 KB
![]() |
72 KB
|
312 KB
|
62 KB
|
37 KB
|
187 KB
|
100 KB
The JVM allocates default initial and maximum heap memory differently for different classes of machines (client vs server) and for different architecture (32-bit vs. 64-bit). The general definition of server-class machine is one with at least 2 CPUs and at least 2GB of physical memory (see details on Server-Class Machine Detection).
Note, to view the maximum heap memory (and other settings) at JVM startup, use the flag -XX:+PrintFlagsFinal
and search for MaxHeapSize
. Divide the value by 1024*1204 to get the number of MB.
For client-class machines:
The only documentation I could find states that "The default maximum heap size is half of the physical memory up to a physical memory size of 192 megabytes and otherwise one fourth of the physical memory up to a physical memory size of 1 gigabyte."
For server-class machines:
This documentation states that the default maximum heap size is the "smaller of 1/4th of the physical memory or 1GB." However, I have found that this information is inaccurate. On my development machine, OS X with 16 GB of physical memory, the JVM allocated 4GB of memory if -Xmx is not specified.
Given the above, assuming we want to focus only on server-class machines, it would useful if QA could gather the default maximum heap allocation data according to the following example matrix (by architecture, OS and physical memory):
Architecture | OS | Physical Memory (GB) | ||||
2 | 4 | 8 | 16 | 32 | ||
32-bit | Windows | |||||
Linux | ||||||
64-bit | Windows | |||||
Linux | ||||||
OS X |
@rohit: can you perform this investigation? based upon your available h/w and vmware, pls let me know which of the below configurations you can test.
Also, in vmware, see if there is a difference between allocating only a single cpu to the vmware instance (what java is considering as a client machine) or allocating 2 or more cpus to the vmware instance (what java is considering as a server machine).
@rohit: can you perform this investigation? based upon your available h/w and vmware, pls let me know which of the below configurations you can test.
Also, in vmware, see if there is a difference between allocating only a single cpu to the vmware instance (what java is considering as a client machine) or allocating 2 or more cpus to the vmware instance (what java is considering as a server machine).
Sachin, we have following bare metal machine available.
Architecture | OS | Physical Memory (GB) | ||
8 | 16 | 24 | ||
64-bit | Windows | Yes | Yes | Yes |
Linux | Yes | Yes | Yes | |
OS X | Yes | No | No |
on the vmware we can test all combinations up to 16GB on Linux and Windows.
Also, the difference we can see, between allocating single cpu or more then two cpu in the Task Manager. If we have allocated one cpu, Task Manger shows only 1 cpu, if we allocate 2 then Task Manager shows 2 cpu's
Sachin, we have following bare metal machine available.
Architecture | OS | Physical Memory (GB) | ||
8 | 16 | 24 | ||
64-bit | Windows | Yes | Yes | Yes |
Linux | Yes | Yes | Yes | |
OS X | Yes | No | No |
on the vmware we can test all combinations up to 16GB on Linux and Windows.
Also, the difference we can see, between allocating single cpu or more then two cpu in the Task Manager. If we have allocated one cpu, Task Manger shows only 1 cpu, if we allocate 2 then Task Manager shows 2 cpu's
Steps followed to collect data.
Install Java 8 on the machine.
Then, run the below command to find MaxHeapSize, as given in the link.
java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
Look for MaxHeapSize from the result given by above command and then divide that value by 1024*1024*1024
Architecture | OS | Physical Memory (GB) | ||
8 | 16 | 24 | ||
64-bit | Windows | 1.97 | 3.97 | 1.97 |
Linux | 1.92 | 3.89 | 5.85 | |
OS X | 2 |
For 24GB memory, I have verified against two different machine, and both returns same result. I have sttached screenshot of observations for 24GB RAM machine.
Please let me know if the approach taken is right or not. If yes then will share readings of Vmware machines after your confirmation.
[SP] For the bare metal tests, pls include # of CPUs as that might impact the max heap size allocation algorithm
Number of Cores on Different OS.
Windows: 4
Linux: 4
OS X: 4
[SP] Pls double check your OS CPU #s. For instance, you specify that OS X has 4 cores? Can you launch "System Information" on OS X & send me a screenshot of the "hardware overview" section.
<RR> I have attached the screen shot for both OSX and Windows. Yes on OSX has 4 cores.
Also, based off the Windows screenshot that you provided for your 24 GB physical machine, the processor is "i7-3770". This processor has 4 cores, not 8. Link here. Seems you're counting the # of threads instead of cores. Since you have multiple different bare metal machines for windows & Linux, do they all have the same # of cores?
<RR> Yes all Windows and Linux machines have the same number of cores.
[SP] Did you see the link I attached above? It states that your Windows processor has 4 cores.
<RR> Yes i have seen that post and based on that only i have attached image of number of cores on windows machine.
Lets try using the tool mentioned in this post & provide a screenshot of what it shows on your windows box.
<RR> I have download the tool, and after installation it also displays that we have 4 cores and 8 threads. Please have a look at attached image Number_of_cores.
[SP] Since you've confirmed this, can you update your table to say: "Number of Cores on Different OS." instead of "Number of CPU's on Different OS." and change the number to 4 instead of 8 for windows & linux.
Steps followed to collect data.
Install Java 8 on the machine.
Then, run the below command to find MaxHeapSize, as given in the link.
java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
Look for MaxHeapSize from the result given by above command and then divide that value by 1024*1024*1024
Architecture | OS | Physical Memory (GB) | ||
8 | 16 | 24 | ||
64-bit | Windows | 1.97 | 3.97 | 1.97 |
Linux | 1.92 | 3.89 | 5.85 | |
OS X | 2 |
For 24GB memory, I have verified against two different machine, and both returns same result. I have sttached screenshot of observations for 24GB RAM machine.
Please let me know if the approach taken is right or not. If yes then will share readings of Vmware machines after your confirmation.
[SP] For the bare metal tests, pls include # of CPUs as that might impact the max heap size allocation algorithm
Number of Cores on Different OS.
Windows: 4
Linux: 4
OS X: 4
[SP] Pls double check your OS CPU #s. For instance, you specify that OS X has 4 cores? Can you launch "System Information" on OS X & send me a screenshot of the "hardware overview" section.
<RR> I have attached the screen shot for both OSX and Windows. Yes on OSX has 4 cores.
Also, based off the Windows screenshot that you provided for your 24 GB physical machine, the processor is "i7-3770". This processor has 4 cores, not 8. Link here. Seems you're counting the # of threads instead of cores. Since you have multiple different bare metal machines for windows & Linux, do they all have the same # of cores?
<RR> Yes all Windows and Linux machines have the same number of cores.
[SP] Did you see the link I attached above? It states that your Windows processor has 4 cores.
<RR> Yes i have seen that post and based on that only i have attached image of number of cores on windows machine.
Lets try using the tool mentioned in this post & provide a screenshot of what it shows on your windows box.
<RR> I have download the tool, and after installation it also displays that we have 4 cores and 8 threads. Please have a look at attached image Number_of_cores.
[SP] Since you've confirmed this, can you update your table to say: "Number of Cores on Different OS." instead of "Number of CPU's on Different OS." and change the number to 4 instead of 8 for windows & linux.
@Sachin For VM, we will be setting the number of CPU from VM player settings. Please have a look at the screenshot Window_VM_Configuration. In the screenshot, you can see that the Task Manger shows only 2 CPUs units, as we have allocated 2 from VM settings.Should we proceed like this only? Please let me know.
[SP] Download & run the tool that I provided the link for in my previous post & lets see what that tool reports.
<RR>. If we set one Processor from VM settings then tool displays 1 core and 1 thread. If we set 2 Processors from VM setting then it displays 2 cores and 2 thread. Please have a look at attached image, Number_cores_OnVM
[SP] Looks like you can proceed testing both Single Processor (one core) and "2 Processor" (2 cores)
@Sachin For VM, we will be setting the number of CPU from VM player settings. Please have a look at the screenshot Window_VM_Configuration. In the screenshot, you can see that the Task Manger shows only 2 CPUs units, as we have allocated 2 from VM settings.Should we proceed like this only? Please let me know.
[SP] Download & run the tool that I provided the link for in my previous post & lets see what that tool reports.
<RR>. If we set one Processor from VM settings then tool displays 1 core and 1 thread. If we set 2 Processors from VM setting then it displays 2 cores and 2 thread. Please have a look at attached image, Number_cores_OnVM
[SP] Looks like you can proceed testing both Single Processor (one core) and "2 Processor" (2 cores)
Tests on VMware
Architecture | Number Of Cores | OS | Physical Memory (GB) | |||||
2 | 4 | 8 | 16 | 32 | ||||
64-bit | 1 | Windows | 0.5 | 1 | 2 | |||
Linux | .48 | .96 | 1.94 | 3.91 | ||||
2 | Windows | 0.5 | 1 | 2 | ||||
Linux | .48 | .96 | 1.94 | 3.91 | ||||
3 | Windows | 0.5 | 1 | 2 | ||||
Linux | .48 | .96 | 1.94 | 3.91 |
For windows i have run test on two different machines which have more memory, both these machines display 0 as value for MaxHeapSize.
For 2,4 and 8 GB i have run the test on my machine and output is as given in table,
Tests on VMware
Architecture | Number Of Cores | OS | Physical Memory (GB) | |||||
2 | 4 | 8 | 16 | 32 | ||||
64-bit | 1 | Windows | 0.5 | 1 | 2 | |||
Linux | .48 | .96 | 1.94 | 3.91 | ||||
2 | Windows | 0.5 | 1 | 2 | ||||
Linux | .48 | .96 | 1.94 | 3.91 | ||||
3 | Windows | 0.5 | 1 | 2 | ||||
Linux | .48 | .96 | 1.94 | 3.91 |
For windows i have run test on two different machines which have more memory, both these machines display 0 as value for MaxHeapSize.
For 2,4 and 8 GB i have run the test on my machine and output is as given in table,
@ranarohitp: on bare metal windows machine w/ 24GB ram, can you run "dxdiag" and attach the results of the "Save All Information".
@ranarohitp: on bare metal windows machine w/ 24GB ram, can you run "dxdiag" and attach the results of the "Save All Information".
@Sachin, I have attached the output. Please have a look at attached DxDiag_output.txt file.
@Sachin, I have attached the output. Please have a look at attached DxDiag_output.txt file.
@asif: pls do the following: Remove the MaxMetaspaceSize parameter from all our .bat/.sh, etc files
We will still keep the Xmx parameter. In this issue, pls enumerate all the changed files so that QA can retest.
@asif: pls do the following: Remove the MaxMetaspaceSize parameter from all our .bat/.sh, etc files
We will still keep the Xmx parameter. In this issue, pls enumerate all the changed files so that QA can retest.
Removed the MaxMetaspaceSize parameter from our datasudio .bat/.sh, files:
@QA,
These files are distributed in different OS packages. Please test the respective scripts in Windows (.bat files), OSX (-osx.sh files) and Linux (.sh files).
Removed the MaxMetaspaceSize parameter from our datasudio .bat/.sh, files:
@QA,
These files are distributed in different OS packages. Please test the respective scripts in Windows (.bat files), OSX (-osx.sh files) and Linux (.sh files).
From Kin-Hong:
I have checked-in the corrected "runfluidscript-osx-app.sh" and "runscript-osx-app.sh" files.
From Jenny:
I've checked in the fix for the ExceptionInInitializerError exception when using runfluidscript-bundled.
From Kin-Hong:
I have checked-in the corrected "runfluidscript-osx-app.sh" and "runscript-osx-app.sh" files.
From Jenny:
I've checked in the fix for the ExceptionInInitializerError exception when using runfluidscript-bundled.
Scenario 1: OSXADS Build : ads-osx-18.0.0-preview-221.On OSX, datastudio-osx.sh,runfluidscript-osx.sh and runscript-osx.sh files (Files which present under "Aqua Data Studio.app/Contents/Resources" folder) are not executed and display's following error on executing file./runfluidscript-osx.sh: line 36: ./jre/bin/java: No such file or directoryIs this expected result? becuase In ADS v17 (ads-osx-17.0.11) same error is displayed if we execute datastudio-osx.sh,runfluidscript-osx.sh and runscript-osx.sh files (Files which present under "Aqua Data Studio.app/Contents/Resources" folder)Please refer attached screenshot Incorrect jre path for osx-sh .[If we use ADS-OSX-UNIX-18-Preview-22 build to run " datastudio-osx.sh" file then all the osx.sh files executed successfully without any error.Above scenario is reproducible only if we use "ADS-OSX-18.0.0-preview-22" to run datastudio-osx.sh,runfluidscript-osx.sh and runscript-osx.sh files]
Scenario 1: OSXADS Build : ads-osx-18.0.0-preview-221.On OSX, datastudio-osx.sh,runfluidscript-osx.sh and runscript-osx.sh files (Files which present under "Aqua Data Studio.app/Contents/Resources" folder) are not executed and display's following error on executing file./runfluidscript-osx.sh: line 36: ./jre/bin/java: No such file or directoryIs this expected result? becuase In ADS v17 (ads-osx-17.0.11) same error is displayed if we execute datastudio-osx.sh,runfluidscript-osx.sh and runscript-osx.sh files (Files which present under "Aqua Data Studio.app/Contents/Resources" folder)Please refer attached screenshot Incorrect jre path for osx-sh .[If we use ADS-OSX-UNIX-18-Preview-22 build to run " datastudio-osx.sh" file then all the osx.sh files executed successfully without any error.Above scenario is reproducible only if we use "ADS-OSX-18.0.0-preview-22" to run datastudio-osx.sh,runfluidscript-osx.sh and runscript-osx.sh files]
Scenario 2: Run x86 ADS build on 64-bit Ubuntu machineADS Build : ads-linux-x86-18.0.0-preview-22 on 64-bit Ubuntu machine1.Open terminal and give path of ads-linux-x86-18.0.0-preview-22 build on 64-bit unbuntu machine.2.on terminal execute ./datastudio-bundled.sh fileResult : ADS does not started if we run ./datastudio-bundled.sh (which present in ads-linux-x86-18.0.0-preview-22 folder) on 64-bit unbuntu machine.Is this expected result? because on 64-bit windows machine if we run datastudio-bundled.bat file ADS started successfully (i.e on 64-bit windows machine 32-bit ads, datastudio-bundled.bat executed and ADS started successfully )Note - if we run ./datastudio.sh (which present in ads-linux-x86-18.0.0-preview-22 folder) ADS started successfully on 64-bit unbuntu machine.
Scenario 2: Run x86 ADS build on 64-bit Ubuntu machineADS Build : ads-linux-x86-18.0.0-preview-22 on 64-bit Ubuntu machine1.Open terminal and give path of ads-linux-x86-18.0.0-preview-22 build on 64-bit unbuntu machine.2.on terminal execute ./datastudio-bundled.sh fileResult : ADS does not started if we run ./datastudio-bundled.sh (which present in ads-linux-x86-18.0.0-preview-22 folder) on 64-bit unbuntu machine.Is this expected result? because on 64-bit windows machine if we run datastudio-bundled.bat file ADS started successfully (i.e on 64-bit windows machine 32-bit ads, datastudio-bundled.bat executed and ADS started successfully )Note - if we run ./datastudio.sh (which present in ads-linux-x86-18.0.0-preview-22 folder) ADS started successfully on 64-bit unbuntu machine.
Note - if we run ./datastudio.sh (which present in ads-linux-x86-18.0.0-preview-22 folder) ADS started successfully on 64-bit unbuntu machine.
When you run ./datastudio.sh file, ADS is launched using the default JVM installed on your OS, if present. In your environment, you must have a JVM already installed. Since you're running on a 64-bit OS, the default JVM installed will also be 64-bit. But you will run into issues when ADS tries to access any native DLLs such as those used by charting. Native DLLs are packaged based upon target OS. Pls do not attempt to do this on Linux as it is not supported.
Note - if we run ./datastudio.sh (which present in ads-linux-x86-18.0.0-preview-22 folder) ADS started successfully on 64-bit unbuntu machine.
When you run ./datastudio.sh file, ADS is launched using the default JVM installed on your OS, if present. In your environment, you must have a JVM already installed. Since you're running on a 64-bit OS, the default JVM installed will also be 64-bit. But you will run into issues when ADS tries to access any native DLLs such as those used by charting. Native DLLs are packaged based upon target OS. Pls do not attempt to do this on Linux as it is not supported.
1.The -osx.sh are to be run when using ads-osx-unix binary. The -osx-app.sh files are to be run when using the ads-osx binary. Pls confirm that you've executed these & that they work w/ the associated binary.
>>Verified that -osx.sh files executed successfully using ads-osx-unix binary and -osx-app.sh files executed successfully using ads-osx binary.
2. Pls confirm that you've run the ADS 32-bit Linux binary on a 32-bit Linux OS & all the associated .sh files.
>>Verified on 32-bit Ubuntu VM, all .sh files of 32-bit ADS build executed successfully.
3. Verified all the files mentioned in this comment are executed successfully without any error on 64-bit Windows, Linux, OSX and 32-bit Windows and Linux VM.
Please refer this sheet for detail result of all files.
1.The -osx.sh are to be run when using ads-osx-unix binary. The -osx-app.sh files are to be run when using the ads-osx binary. Pls confirm that you've executed these & that they work w/ the associated binary.
>>Verified that -osx.sh files executed successfully using ads-osx-unix binary and -osx-app.sh files executed successfully using ads-osx binary.
2. Pls confirm that you've run the ADS 32-bit Linux binary on a 32-bit Linux OS & all the associated .sh files.
>>Verified on 32-bit Ubuntu VM, all .sh files of 32-bit ADS build executed successfully.
3. Verified all the files mentioned in this comment are executed successfully without any error on 64-bit Windows, Linux, OSX and 32-bit Windows and Linux VM.
Please refer this sheet for detail result of all files.
@Nisha- please close this issue if no further tests are pending and no feedback waiting from Sachin.
@Nisha- please close this issue if no further tests are pending and no feedback waiting from Sachin.
Issue #14288 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build preview-21,preview-19 |
No time estimate |
1 issue link |
relates to #13217
Issue #13217Since we're using Java 1.8, should we get rid of the MaxPermSize flag? |
The JVM allocates default initial and maximum heap memory differently for different classes of machines (client vs server) and for different architecture (32-bit vs. 64-bit). The general definition of server-class machine is one with at least 2 CPUs and at least 2GB of physical memory (see details on Server-Class Machine Detection).
Note, to view the maximum heap memory (and other settings) at JVM startup, use the flag
-XX:+PrintFlagsFinal
and search forMaxHeapSize
. Divide the value by 1024*1204 to get the number of MB.For client-class machines:
The only documentation I could find states that "The default maximum heap size is half of the physical memory up to a physical memory size of 192 megabytes and otherwise one fourth of the physical memory up to a physical memory size of 1 gigabyte."
For server-class machines:
This documentation states that the default maximum heap size is the "smaller of 1/4th of the physical memory or 1GB." However, I have found that this information is inaccurate. On my development machine, OS X with 16 GB of physical memory, the JVM allocated 4GB of memory if -Xmx is not specified.
Given the above, assuming we want to focus only on server-class machines, it would useful if QA could gather the default maximum heap allocation data according to the following example matrix (by architecture, OS and physical memory):