How can I find MaxPermSize by default when -XX: + PrintFlagsFinal is not supported?

I work with a system in which it is possible to run several tasks implemented as Java applications at the same time. Each job runs in a separate JVM.

Some of these tasks require a larger pergene size than others. However, it is not possible to use all tasks to use the maximum value, since the OS has limited memory.

Therefore, I want to specify -XX:MaxPermSize for each job. Currently, jobs run without the -XX:MaxPermSize , so they should use the default value. But how can I find out what the default value is?

I saw the default values ​​for Xmx, Xms, MaxPermSize on machines of a non-server class , where it is customary to respond to java -XX:+PrintFlagsFinal , which should print the default values. However, the version of the JVM I am running on does not support this argument (Unrecognized VM + PrintFlagsFinal parameter). Updating the new JVM is currently not an option.

So what are my default search options?
System Information:

 > java -version Java(TM) SE Runtime Environment (build 1.6.0_14-b08) Java HotSpot(TM) 64-Bit Server VM (build 14.0-b16, mixed mode) > cat /etc/issue Welcome to SUSE Linux Enterprise Server 11 SP2 (x86_64) - Kernel \r (\l). > uname -r 3.0.101-0.7.17-default 
+1
source share
1 answer

The default values ​​for different regions will depend on:

  • A collector is used (which will depend on the version of Java if you explicitly specify it using CLI arguments).
  • Heap sizes, etc. that you specified using CLI commands. GC will allocate space according to some factors.
  • Installed (or may be available) RAM on the machine.

How to find out:

  • From the GC log files ( -Xloggc:gc.log ), I would expect that, at least in Full GC logs, GC will report Perm Gen sizes. See Examples below. You can take a representative gc log file and find the maximum gen size from it and decide based on this.
  • Additional options like PrintFlagsFinal etc. (specific to Java version)

I will consider options 1.6 to see if I can find and update something, otherwise it is time to update. :-)

Here are 3 examples from different GCs (Metaspace, CMS Perm and PSPermGen are what you are looking for):

 2014-11-14T08:43:53.197-0500: 782.973: [Full GC (Ergonomics) [PSYoungGen: 54477K->0K(917504K)] [ParOldGen: 1042738K->367416K(1048576K)] 1097216K->367416K(1966080K), [Metaspace: 46416K->46389K(1091584K)], 0.4689827 secs] [Times: user=3.52 sys=0.07, real=0.47 secs] 2014-10-29T06:14:56.491-0400: 6.754: [Full GC2014-10-29T06:14:56.491-0400: 6.754: [CMS: 96098K->113997K(5242880K), 0.7076870 secs] 735545K->113997K(6186624K), [CMS Perm : 13505K->13500K(51200K)], 0.7078280 secs] [Times: user=0.69 sys=0.01, real=0.71 secs] 2014-10-29T21:13:33.140-0500: 2644.411: [Full GC [PSYoungGen: 2379K->0K(695296K)] [ParOldGen: 1397977K->665667K(1398272K)] 1400357K->665667K(2093568K) [PSPermGen: 106995K->106326K(262144K)], 1.2151010 secs] [Times: user=6.83 sys=0.09, real=1.22 secs] 
+1
source

Source: https://habr.com/ru/post/979726/


All Articles