{"id":2382,"date":"2022-08-30T15:24:24","date_gmt":"2022-08-30T15:24:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/openfire-java-out-of-memory-error-any-solutions-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:24:24","modified_gmt":"2022-08-30T15:24:24","slug":"openfire-java-out-of-memory-error-any-solutions-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/openfire-java-out-of-memory-error-any-solutions-collection-of-common-programming-errors\/","title":{"rendered":"Openfire Java Out of Memory Error &#8211; Any solutions?-Collection of common programming errors"},"content":{"rendered":"<p>I have huge problem with openfire crashing every now and then because of the lack of memory. In java log i have following error log. however problems are<\/p>\n<ol>\n<li>Openfire is 32 bit and i cant run it as 64 bit.<\/li>\n<li>Because its only 32 bit max memory i can give to the openfire is 4GB.<\/li>\n<li>My system is very powerful with 32 GB RAM so i cant increase any more<\/li>\n<li>Only max 100 users are using the openfire but still cant seems to handle it<\/li>\n<li>I have run a cron jobs every 5 min to monitor this service and restart every now and then<\/li>\n<\/ol>\n<p>any solutions on how to optimize open-fire for memory usage and stop it crashing ?<\/p>\n<p>error log as below<\/p>\n<pre><code>#\n# There is insufficient memory for the Java Runtime Environment to continue.\n# Native memory allocation (malloc) failed to allocate 140 bytes for CHeapObj-new\n# Possible reasons:\n#   The system is out of physical RAM or swap space\n#   In 32 bit mode, the process size limit was hit\n# Possible solutions:\n#   Reduce memory load on the system\n#   Increase physical memory or swap space\n#   Check if swap backing store is full\n#   Use 64 bit Java on a 64 bit OS\n#   Decrease Java heap size (-Xmx\/-Xms)\n#   Decrease number of Java threads\n#   Decrease Java thread stack sizes (-Xss)\n#   Set larger code cache with -XX:ReservedCodeCacheSize=\n# This output file may be truncated or incomplete.\n#\n#  Out of Memory Error (allocation.inline.hpp:44), pid=31239, tid=2735213424\n#\n# JRE version: 6.0_41-b02\n# Java VM: Java HotSpot(TM) Server VM (20.14-b01 mixed mode linux-x86 )\n\n---------------  T H R E A D  ---------------\n\nCurrent thread (0xad2c7000):  JavaThread \"Jetty-QTP-AdminConsole-16012\" [_thread_in_vm, id=21077, stack(0xa3030000,0xa3081000)]\n\nStack: [0xa3030000,0xa3081000],  sp=0xa307f3d4,  free space=316k\nNative frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)\nV  [libjvm.so+0x727990]\n<\/code><\/pre>\n<ol>\n<li>\n<p>Openfire is written in java and is not 32-bit specific. If you use a 64bit jvm, it will run in 64 bit mode and you can give it as much ram as you have. Try installing a 64bit jvm\/jre<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-01-05 22:39:43. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have huge problem with openfire crashing every now and then because of the lack of memory. In java log i have following error log. however problems are Openfire is 32 bit and i cant run it as 64 bit. Because its only 32 bit max memory i can give to the openfire is 4GB. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2382","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2382"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2382\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}