{"id":5142,"date":"2013-03-16T06:02:08","date_gmt":"2013-03-16T10:02:08","guid":{"rendered":"http:\/\/onlineappsdba.com\/?p=5142"},"modified":"2013-03-22T14:40:49","modified_gmt":"2013-03-22T18:40:49","slug":"customizing-heap-size-in-a-weblogic-domain","status":"publish","type":"post","link":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/","title":{"rendered":"Customizing Heap Size in a Weblogic domain"},"content":{"rendered":"<p>We often come across cases where we require to modify the heap size according to our applications\u2019s needs eg java.lang.OutOfMemoryError<br \/>\nWhenever we want to change the Heap size in WebLogic server (AdminServer or managed servers), we can customize setDomainEnv.sh in $DOMAIN_HOME\/bin with required memory arguments.<br \/>\nBelow are the two scenarios:<\/p>\n<p><strong>Scenario 1:<\/strong><br \/>\nWe need to change the memory arguments to a value same for all servers in a Domain. Suppose we want to keep Xmx 1024 M and Xms 1024 M for all server in an Domain (Admin and all managed servers).<br \/>\nWe will edit setDomainEnv.sh in $DOMAIN_HOME\/bin with our required values of Xmx and Xms.<br \/>\nSearch for line \u201c# IF USER_MEM_ARGS the environment variable\u201d in setDomainEnv.sh<br \/>\nWe will add line<br \/>\n<em>USER_MEM_ARGS=&#8221;-Xms1024m -Xmx1024m&#8221;<\/em><br \/>\n<em> export USER_MEM_ARGS<\/em><br \/>\nbelow line \u201c # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values\u201d<br \/>\nand above line \u201c if [ &#8220;${USER_MEM_ARGS}&#8221; != &#8220;&#8221; ] ; then\u201d<br \/>\nExample :<br \/>\n# IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values<br \/>\n<em>USER_MEM_ARGS=&#8221;-Xms1024m -Xmx1024m&#8221;<\/em><br \/>\n<em> export USER_MEM_ARGS<\/em><br \/>\nif [ &#8220;${USER_MEM_ARGS}&#8221; != &#8220;&#8221; ] ; then<br \/>\nMEM_ARGS=&#8221;${USER_MEM_ARGS}&#8221;<br \/>\nexport MEM_ARGS<br \/>\nfi<\/p>\n<p><strong>Scenario 2:<\/strong><br \/>\nWe need to change the memory arguments to values different for all servers in a Domain. Suppose we want to keep Xmx 512 M and Xms 512 M for Admin server and Xmx 1g and Xms 1g for ebsag_server and oam_server1 managed servers in a Domain<br \/>\nWe will edit setDomainEnv.sh in $DOMAIN_HOME\/bin with our required values of Xmx and Xms.<br \/>\nSearch for line \u201c# IF USER_MEM_ARGS the environment variable\u201d in setDomainEnv.sh<br \/>\nWe will add lines<br \/>\n<em>case &#8220;${SERVER_NAME}&#8221; in<\/em><br \/>\n<em> &#8220;AdminServer&#8221;) USER_MEM_ARGS=&#8221;-Xms512m -Xmx512m&#8221; ;;<\/em><br \/>\n<em> &#8220;oam_server1&#8243;) USER_MEM_ARGS=&#8221;-Xms1g -Xmx1g&#8221; ;;<\/em><br \/>\n<em> &#8220;ebsag_server&#8221;) USER_MEM_ARGS=&#8221;-Xms1g -Xmx1g&#8221; ;; *)<\/em><br \/>\n<em> echo &#8220;Unknown Server Detected!!. Memory set as Xms1g Xmx2g.&#8221;;<\/em><br \/>\n<em> USER_MEM_ARGS=&#8221;-Xms1g -Xmx2g&#8221; ;;<\/em><br \/>\n<em> esac<\/em><br \/>\n<em> USER_MEM_ARGS=&#8221;${USER_MEM_ARGS} -d64 -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.awtheadless=true -Djbo.ampool.maxpoolsize=600000&#8243;<\/em><br \/>\nBelow line \u201c # IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values\u201d and above line \u201c if [ &#8220;${USER_MEM_ARGS}&#8221; != &#8220;&#8221; ] ; then\u201d<\/p>\n<p>Note that we are using Switch case programming concept in defining different memory arguments for different servers in this domain. We can edit this switch case as per our requirements.<br \/>\nExample :<br \/>\n# IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values<\/p>\n<p>case &#8220;${SERVER_NAME}&#8221; in<br \/>\n&#8220;AdminServer&#8221;) USER_MEM_ARGS=&#8221;-Xms512m -Xmx512m&#8221; ;;<br \/>\n&#8220;oam_server1&#8243;) USER_MEM_ARGS=&#8221;-Xms1g -Xmx1g&#8221; ;;<br \/>\n&#8220;ebsag_server&#8221;) USER_MEM_ARGS=&#8221;-Xms1g -Xmx1g&#8221; ;; *)<br \/>\necho &#8220;Unknown Server Detected!!. Memory set as Xms1g Xmx2g.&#8221;;<br \/>\nUSER_MEM_ARGS=&#8221;-Xms1g -Xmx2g&#8221; ;;<br \/>\nesac<br \/>\nUSER_MEM_ARGS=&#8221;${USER_MEM_ARGS} -d64 -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.awtheadless=true -Djbo.ampool.maxpoolsize=600000&#8243;<\/p>\n<p>if [ &#8220;${USER_MEM_ARGS}&#8221; != &#8220;&#8221; ] ; then<br \/>\nMEM_ARGS=&#8221;${USER_MEM_ARGS}&#8221;<br \/>\nexport MEM_ARGS<br \/>\nfi<\/p>\n<p>This change will be reflected when the Servers are bounced . The new heap size change can be confirmed from the Admin console of the domain (Click on servers -&gt; server_name -&gt; monitoring -&gt; performance) or from server_name.log or server_name.out in $DOMAIN_HOME\/servers\/Server_Name\/logs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We often come across cases where we require to modify the heap size according to our applications\u2019s needs eg java.lang.OutOfMemoryError [&hellip;]<\/p>\n","protected":false},"author":115,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[217],"tags":[379,378,479],"class_list":["post-5142","post","type-post","status-publish","format-standard","hentry","category-weblogic","tag-domain","tag-heap","tag-weblogic"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Customizing Heap Size in a Weblogic domain -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Customizing Heap Size in a Weblogic domain -\" \/>\n<meta property=\"og:description\" content=\"We often come across cases where we require to modify the heap size according to our applications\u2019s needs eg java.lang.OutOfMemoryError [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-16T10:02:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-03-22T18:40:49+00:00\" \/>\n<meta name=\"author\" content=\"Masroof Ahmad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Masroof Ahmad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/\",\"url\":\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/\",\"name\":\"Customizing Heap Size in a Weblogic domain -\",\"isPartOf\":{\"@id\":\"https:\/\/onlineappsdba.com\/#website\"},\"datePublished\":\"2013-03-16T10:02:08+00:00\",\"dateModified\":\"2013-03-22T18:40:49+00:00\",\"author\":{\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb\"},\"breadcrumb\":{\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/onlineappsdba.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Customizing Heap Size in a Weblogic domain\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/onlineappsdba.com\/#website\",\"url\":\"https:\/\/onlineappsdba.com\/\",\"name\":\"\",\"description\":\"Oracle Implementation &amp; Training Experts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/onlineappsdba.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb\",\"name\":\"Masroof Ahmad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g\",\"caption\":\"Masroof Ahmad\"},\"url\":\"https:\/\/onlineappsdba.com\/index.php\/author\/masroof\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Customizing Heap Size in a Weblogic domain -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/","og_locale":"en_US","og_type":"article","og_title":"Customizing Heap Size in a Weblogic domain -","og_description":"We often come across cases where we require to modify the heap size according to our applications\u2019s needs eg java.lang.OutOfMemoryError [&hellip;]","og_url":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/","article_published_time":"2013-03-16T10:02:08+00:00","article_modified_time":"2013-03-22T18:40:49+00:00","author":"Masroof Ahmad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Masroof Ahmad","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/","url":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/","name":"Customizing Heap Size in a Weblogic domain -","isPartOf":{"@id":"https:\/\/onlineappsdba.com\/#website"},"datePublished":"2013-03-16T10:02:08+00:00","dateModified":"2013-03-22T18:40:49+00:00","author":{"@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb"},"breadcrumb":{"@id":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/onlineappsdba.com\/index.php\/2013\/03\/16\/customizing-heap-size-in-a-weblogic-domain\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/onlineappsdba.com\/"},{"@type":"ListItem","position":2,"name":"Customizing Heap Size in a Weblogic domain"}]},{"@type":"WebSite","@id":"https:\/\/onlineappsdba.com\/#website","url":"https:\/\/onlineappsdba.com\/","name":"","description":"Oracle Implementation &amp; Training Experts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/onlineappsdba.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb","name":"Masroof Ahmad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g","caption":"Masroof Ahmad"},"url":"https:\/\/onlineappsdba.com\/index.php\/author\/masroof\/"}]}},"_links":{"self":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts\/5142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/comments?post=5142"}],"version-history":[{"count":0,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts\/5142\/revisions"}],"wp:attachment":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/media?parent=5142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/categories?post=5142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/tags?post=5142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}