JVM 崩潰 Failed to write core dump解決辦法 WINDOWS


JVM 崩潰 Failed to write core dump解決辦法 WINDOWS

MIT
key words: JVM,崩潰,windows,Failed,core dump,虛擬內存

最近從平台中分出了一個小項目,沒有配置單獨的服務器,而是需要部署到公司網站服務器(windows server)上去。
一共部署一個網站,一個設備通信服務jar
阿里雲ECS 4G 內存,系統:windows server 2008 SP1 64位 未激活

一開始查看了下java環境變量,設置得非常亂,上面裝了兩個java,一個64位一個32位,但是path指向的都是32位的java。

通信服務jar能夠順利啟動,不過隔三差五就掛掉,報JVM異常

tomcat 一開始啟動就不順利,重新設定了JAVA_HOME才啟動,后來也沒過幾天又掛掉了,后來再也啟動不了了。。。。。

當時直接在bin目錄生成的日志hs_err_pid1234.log內容是:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32744 bytes for ChunkPool::allocate
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (allocation.cpp:273), pid=2620, tid=4872
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b15) (build 1.8.0_45-b15)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. 
....以下省略超多jvm異常

不外乎說內存不夠,64位的OS 沒有用64位的java,減少java 線程數,等等之內的,但是我看了下任務管理器,線程數也不多,4G物理內存,才用了1.2G

沒辦法,只好把java全部卸載,重新安裝64位版本的。重新設定JAVA_HOME和PATH,發揮JAVA最大功效。還是沒好,然后又把盜版系統激活重新,還是沒好

最后,我在通過運行DxDiag 查看系統信息時才發現問題:

一開始的System Information:

------------------
Time of this report: 12/15/2015, 13:54:13
       Machine name: iZ23leuxxxxx
   Operating System: Windows Server 2008 R2 Standard 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.130708-1532)
           Language: Chinese (Simplified) (Regional Setting: Chinese (Simplified))
System Manufacturer: Xen
       System Model: HVM domU
               BIOS: Revision: 1.221 
          Processor: Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz (2 CPUs), ~2.2GHz
             Memory: 4096MB RAM
Available OS Memory: 4096MB RAM
          Page File: 3908MB used, 184MB available
        Windows Dir: C:\Windows
    DirectX Version: DirectX 11
DX Setup Parameters: Not found
   User DPI Setting: Using System DPI
 System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
     DxDiag Version: 6.01.7601.17514 32bit Unicode

------------

其中Page File: 3908MB used, 184MB available ,184M,太小了,然后到C盤查看隱藏文件,居然沒發現pagefile.sys文件。
也就是沒有設置虛擬內存。。。。。

設置完虛擬內存后:

Time of this report: 12/15/2015, 14:07:22
   Machine name: iZ23leuxxxxx
   Operating System: Windows Server 2008 R2 Standard 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.130708-1532)
           Language: Chinese (Simplified) (Regional Setting: Chinese (Simplified))
System Manufacturer: Xen
       System Model: HVM domU
               BIOS: Revision: 1.221 
          Processor: Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz (2 CPUs), ~2.2GHz
             Memory: 4096MB RAM
Available OS Memory: 4096MB RAM
          Page File: 4486MB used, 6703MB available
        Windows Dir: C:\Windows
    DirectX Version: DirectX 11
DX Setup Parameters: Not found
   User DPI Setting: Using System DPI
 System DPI Setting: 96 DPI (100 percent)
    DWM DPI Scaling: Disabled
     DxDiag Version: 6.01.7601.17514 32bit Unicode

再次啟動tomcat,順利啟動,設備通信服務也沒再掛過了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM