Java 8 在使用内存爆了以后会发生什么?hs_err_pid 日志如何看?
问题:
Java进程被终止了,然后在应用的目录中发现了hs_err_pid日志。
运维反馈,结论是内存不够了
之前一直运行没有问题,没什么新增访问量,为什么会内存溢出,进程被killer掉类?
1.第一反应看日志:
hs_err_pid,内容如下:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 65536 bytes for committing reserved memory.
# Possible reasons:
# The system is out of physical RAM or swap space
# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# JVM is running with Unscaled Compressed Oops mode in which the Java heap is
# placed in the first 4GB address space. The Java Heap base address is the
# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
# to set the Java Heap base and to place the Java Heap above 4GB virtual address.
# This output file may be truncated or incomplete.
#
# Out of Memory Error (os_linux.cpp:2798), pid=15490, tid=0x00007f47859bc700
#
# JRE version: OpenJDK Runtime Environment (8.0_262-b10) (build 1.8.0_262-b10)
# Java VM: OpenJDK 64-Bit Server VM (25.262-b10 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
# --------------- T H R E A D --------------- Current thread (0x00007f47b4196800): JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=15500, stack(0x00007f47858bd000,0x00007f47859bd000)] Stack: [0x00007f47858bd000,0x00007f47859bd000], sp=0x00007f47859b85a0, free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xb5718d] VMError::report_and_die()+0x15d
V [libjvm.so+0x50675a] report_vm_out_of_memory(char const*, int, unsigned long, VMErrorType, char const*)+0xaa
V [libjvm.so+0x93d3f8] os::pd_commit_memory(char*, unsigned long, unsigned long, bool)+0xd8
V [libjvm.so+0x93457e] os::commit_memory(char*, unsigned long, unsigned long, bool)+0x2e
V [libjvm.so+0xb53d94] VirtualSpace::expand_by(unsigned long, bool)+0x1b4
V [libjvm.so+0x61d15c] CodeHeap::expand_by(unsigned long)+0x6c
V [libjvm.so+0x48e0e6] CodeCache::allocate(int, bool)+0x46
V [libjvm.so+0x4865db] BufferBlob::create(char const*, int)+0x8b
V [libjvm.so+0x48b0e1] CodeBuffer::initialize(int, int)+0x21
V [libjvm.so+0x951a62] Compile::init_buffer(unsigned int*)+0x212
V [libjvm.so+0x959201] Compile::Output()+0x351
V [libjvm.so+0x4ae738] Compile::Code_Gen()+0x4e8
V [libjvm.so+0x4b23ce] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool)+0x116e
V [libjvm.so+0x407e88] C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x1d8
V [libjvm.so+0x4b9cb2] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x8d2
V [libjvm.so+0x4ba980] CompileBroker::compiler_thread_loop()+0x510
V [libjvm.so+0xafe902] JavaThread::thread_main_inner()+0x212
V [libjvm.so+0x93a382] java_start(Thread*)+0xf2
C [libpthread.so.0+0x7ea5] start_thread+0xc5 Current CompileTask:
C2:859196826 31212 4 org.hibernate.engine.query.spi.HQLQueryPlan::<init> (382 bytes) --------------- P R O C E S S --------------- Java Threads: ( => current thread )
用jcmd -l 查看JVM 参数如下:
输入:
sudo -u gitlab-runner jcmd 28102 help
VM.native_memory
ManagementAgent.stop
ManagementAgent.start_local
ManagementAgent.start
VM.classloader_stats
GC.rotate_log
Thread.print
GC.class_stats
GC.class_histogram
GC.heap_dump
GC.finalizer_info
GC.heap_info
GC.run_finalization
GC.run
VM.uptime
VM.dynlibs
VM.flags
VM.system_properties
VM.command_line
VM.version
help
输入:
sudo -u gitlab-runner jcmd 28102 VM.command_line
VM Arguments:
jvm_args: -Xms1200m -Xmx1200m
java_command: xxx.jar --spring.profiles.active=prod
java_class_path (initial): xxxxxx.jar
Launcher Type: SUN_STANDARD
而物理机的内存为:
3.8G
现在的疑惑是内存在没什么访问的情况下,究竟为什么会内存爆掉?内存泄漏?
(未完待续)
Java 8 在使用内存爆了以后会发生什么?hs_err_pid 日志如何看?的更多相关文章
- java的GC与内存泄漏
从诞生至今,20多年过去,Java至今仍是使用最为广泛的语言.这仰赖于Java提供的各种技术和特性,让开发人员能优雅的编写高效的程序.今天我们就来说说Java的一项基本但非常重要的技术内存管理 了解C ...
- 死磕内存篇 --- JAVA进程和linux内存间的大小关系
运行个JAVA 用sleep去hold住 package org.hjb.test; public class TestOnly { public static void main(String[] ...
- JAVA基础知识点:内存、比较和Final
1.java是如何管理内存的 java的内存管理就是对象的分配和释放问题.(其中包括两部分) 分配:内存的分配是由程序完成的,程序员需要通过关键字new为每个对象申请内存空间(基本类型除外),所有的对 ...
- java程序运行时内存分配详解 (转)
转自:http://www.tuicool.com/articles/uU77v2 一. 基本概念 每运行一个java程序会产生一个java进程,每个java进程可能包含一个或者多个线程,每一个Ja ...
- [转]使用Java Mission Control进行内存分配分析
jdk7u40自带了一个非常好用的工具,就是Java Mission Control.JRockit Misson Control用户应该会对mission control的很多功能十分熟悉,JRoc ...
- Java是如何管理内存的?
本文转自CSDN用户Kevin涂腾飞的文章java内存管理机制:http://blog.csdn.net/tutngfei1129287460/article/details/7383480 JAVA ...
- Java虚拟机学习 - 体系结构 内存模型
一:Java技术体系模块图 二:JVM内存区域模型 1.方法区 也称"永久代” .“非堆”, 它用于存储虚拟机加载的类信息.常量.静态变量.是各个线程共享的内存区域.默认最小值为16MB,最 ...
- 方法:Linux 下用JAVA获取CPU、内存、磁盘的系统资源信息
CPU使用率: InputStream is = null; InputStreamReader isr = null; BufferedReader brStat = null; StringTok ...
- Java宝典(四)------Java中也存在内存泄露。
--Java中会存在内存泄露吗? --如果你想当然的以为Java里有了垃圾回收机制就不会存在内存泄露,那你就错了. Java里也会存在内存泄露! 我们慢慢来分析. 所谓内存泄露就是指一个不再被程序使用 ...
- java中三种常见内存溢出错误的处理方法
更多 10 相信有一定java开发经验的人或多或少都会遇到OutOfMemoryError的问题,这个问题曾困扰了我很长时间,随着解决各类问题经验的积累以及对问题根源的探索,终于有了一个比较深入的 ...
随机推荐
- [编程基础] Python中的绝对导入与相对导入
如果您从事的Python项目有多个文件,那么您以前可能不得不使用import语句.即使对于拥有多个项目的Python重度使用者(比如我),import也可能会造成混淆!您可能正在阅读本文,因为您想对P ...
- Goby安装与使用
前言 Goby是一款基于网络空间测绘技术的新一代网络安全工具,它通过给目标网络建立完整的资产知识库,进行网络安全事件应急与漏洞应急. Goby可提供最全面的资产识别,目前预置了超过10万种规则识别引擎 ...
- Angular8中共享模块,共享组件的写法(anular其他模块组件引用方法)
Angular8中共享模块,共享组件的写法(anular其他模块组件引用方法) 第一步:全局创建一个共享的module 这里示例创建一个模块common-share 创建完成后,会生成两个文件 文件1 ...
- Java进阶 P-2.1+P-2.2
对象的识别 对于Java而言,要识别两个对象是否为同一个对象有两种方式: 一是根据内存地址识别("=="号 识别) 二是根据equals() .hasCode()方法识别(默认比较 ...
- 内存概述-java虚拟机的内存划分
内存概述 内存是计算机中的重要原件,临时存储区域,作用是运行程序,我们编写写的程序是存放在硬盘中的,在硬盘中的程 序是不会运行的,必须放进内存中才能运行,运行完毕后会清空内存. Java虚拟机要运行程 ...
- APP测试注意点-安装卸载与运行
1.安装和卸载 应用在不同系统版本的ios和android是否可以正常安装(适配问题) 安装过程中是否可以取消 手机存储空间不足时安装应用是否有相应提示信息 安装后的应用是否可以正常卸载 卸载后是否会 ...
- (Crack)SQL转Linq工具的使用——Linqer
官方下载网站:http://www.sqltolinq.com/ 这是干什么用的 就是Sql语句转Linq 给不熟悉的小白用 再用Linq 转 Lambda (用到Linq ...
- python线程池等待全部任务结束再继续
import json import time from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED impor ...
- 【已解决】csv数据导入sql by sqlyog 乱码+无法导入导入步骤分析等总结
csv数据导入sql 用sqlyog工具 首先是创建一个数据库 --> 然后右键点击数据库->选择创建表 ->表名自己写,让在引擎这里选择csv 然后注意 把非空都勾选了!不然会报错 ...
- 项目与自身毕设对比整理规划6 330 done
3.30 没用呢- - 功夫不负有心人啊啊啊啊啊啊啊啊啊啊啊啊啊啊 成功了- - 但是很可恶 需要把数据返回然后放在那个文件里面才可以 现在就是问题就是返回数据的时候需要把这个文件存成数据接口 fin ...