{"id":541,"date":"2014-11-04T14:33:03","date_gmt":"2014-11-04T14:33:03","guid":{"rendered":"http:\/\/shirishranjit.com\/blog1\/?page_id=541"},"modified":"2015-07-23T13:31:27","modified_gmt":"2015-07-23T17:31:27","slug":"tuning-java-virtual-machine","status":"publish","type":"page","link":"https:\/\/shirishranjit.com\/blog1\/java-stuff\/tuning-java-virtual-machine","title":{"rendered":"Tuning Java Virtual Machine"},"content":{"rendered":"<p>Find Default JVM configurations in a machine:<br \/>\n<code>java -XX:+PrintFlagsFinal -version<\/code><\/p>\n<p>Defualt Heap Size in a JVM<br \/>\n<code>java -XX:+PrintFlagsFinal -version | grep HeapSize<\/code><\/p>\n<p><a title=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/6u18-142093.html\" href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/6u18-142093.html\">Defines the heap size calculation<\/a><\/p>\n<p>Performance Improvements<\/p>\n<p>introduces improvements in the following areas:<\/p>\n<p>* Faster jar File Creation<\/p>\n<p>* The fix of a long standing bug related to jar file creation has greatly improved creation time. For example, for a given jar file, it is possible that you might see a creation time improvement in the range of 20 percent. (Refer to 6496274.)<br \/>\nJava Hotspot VM 16.0<\/p>\n<p>* includes version 16.0 of the Java HotSpot Virtual Machine. Contributing to increased performance in this release are several enhancements in Java HotSpot VM 16.0. These include:<br \/>\nImproved NUMA-aware allocation<br \/>\nExtensions to compressed object pointers<\/p>\n<p>* Garbage collection improvements<\/p>\n<p>* Updated Client JVM heap configuration<\/p>\n<p>* In the Client JVM, the default Java heap configuration has been modified to improve the performance of today&#8217;s rich client applications. Initial and maximum heap sizes are larger and settings related to generational garbage collection are better tuned.<br \/>\n* 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.<\/p>\n<p>For example, if your machine has 128 megabytes of physical memory, then the maximum heap size is 64 megabytes, and greater than or equal to 1 gigabyte of physical memory results in a maximum heap size of 256 megabytes.<\/p>\n<p>* The maximum heap size is not actually used by the JVM unless your program creates enough objects to require it. A much smaller amount, termed the initial heap size, is allocated during JVM initialization. This amount is at least 8 megabytes and otherwise 1\/64 of physical memory up to a physical memory size of 1 gigabyte.<\/p>\n<p>* The maximum amount of space allocated to the young generation is one third of the total heap size.\u00a0The updated heap configuration ergonomics apply to all collectors except Concurrent Mark-Sweep (CMS). CMS heap configuration ergonomics remain the same.<\/p>\n<p>* Server JVM heap configuration ergonomics are now the same as the Client, except that the default maximum heap size for 32-bit JVMs is 1 gigabyte, corresponding to a physical memory size of 4 gigabytes, and for 64-bit JVMs is 32 gigabytes, corresponding to a physical memory size of 128 gigabytes.<\/p>\n<p>* JVM Memory Partition<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/technotes\/guides\/management\/figures\/generations.gif\" alt=\"The different generations of data defined by the Garbage Collector\" \/><\/p>\n<p>Reference:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.oracle.com\/javase\/7\/docs\/technotes\/guides\/management\/jconsole.html\">Info in the jconsole doc<\/a><\/li>\n<\/ul>\n<div class=\"twttr_buttons\"><div class=\"twttr_twitter\">\n\t\t\t\t\t<a href=\"http:\/\/twitter.com\/share?text=Tuning+Java+Virtual+Machine\" class=\"twitter-share-button\" data-via=\"\" data-hashtags=\"\"  data-size=\"default\" data-url=\"https:\/\/shirishranjit.com\/blog1\/java-stuff\/tuning-java-virtual-machine\"  data-related=\"\" target=\"_blank\">Tweet<\/a>\n\t\t\t\t<\/div><div class=\"twttr_followme\">\n\t\t\t\t\t\t<a href=\"https:\/\/twitter.com\/shiranjit\" class=\"twitter-follow-button\" data-size=\"default\"  data-show-screen-name=\"false\"  target=\"_blank\">Follow me<\/a>\n\t\t\t\t\t<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Find Default JVM configurations in a machine: java -XX:+PrintFlagsFinal -version Defualt Heap Size in a JVM java -XX:+PrintFlagsFinal -version | grep HeapSize Defines the heap size calculation Performance Improvements introduces improvements in the following areas: * Faster jar File Creation &hellip; <a href=\"https:\/\/shirishranjit.com\/blog1\/java-stuff\/tuning-java-virtual-machine\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":524,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-541","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/541"}],"collection":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":6,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/541\/revisions"}],"predecessor-version":[{"id":989,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/541\/revisions\/989"}],"up":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/524"}],"wp:attachment":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/media?parent=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}