当前位置:网站首页>[222] memory overflow and location
[222] memory overflow and location
2022-07-24 06:22:00 【wheat berry】

The subject part ( See official account for the original :python treasure )
python treasure
https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzU5NjIyOTE4OQ==&scene=123#wechat_redirect
Wheat seedling DB treasure
https://www.xmmup.com/
Answer section
1. brief introduction
out of memory (Out Of Memory, abbreviation OOM) It means that there is too much memory in the application system that cannot be recycled or used , Finally, the memory used for program running is larger than the maximum memory provided . At this point, the program will not run , The system will prompt for memory overflow , Sometimes the software closes automatically , After restarting the computer or software, release part of the memory and the software can run normally , It is configured by the system 、 Data flow 、 Memory overflow error caused by user code and other reasons , Even if the user re performs the task, it is still unavoidable .
Memory leak (Memory Leak) It refers to the heap memory that has been dynamically allocated in the program. For some reason, the program is not released or cannot be released , Cause the waste of system memory , Causes the procedure to run the speed to slow down even the system crashes and so on the serious consequence .memory leak Will eventually lead to out of memory!
2. Memory overflow
tps( The number of messages processed per second Transaction Per Second) There's a lot of volatility , And slowly lower , Even reduced to 0, The response time fluctuates , Slowly rise
adopt jstat(JVMStatisticsMonitoringTool Virtual machine statistics monitoring tool ) Command to see ,Jvm in Old The number of districts is increasing ,FullGC Very often , Corresponding FullGC The time consumed is also increasing . Reference resources https://blog.csdn.net/do_finsh/article/details/122609021
notes :jstat yes JDK A lightweight gadget that comes with you . Full name “Java Virtual Machine statistics monitoring tool”, It is located in java Of bin Under the table of contents , Mainly used JVM Built in instructions for Java Real time command line monitoring of application resources and performance , Yes, yes. Heap size And garbage collection monitoring .
adopt jconsole/jvisualvm You can see , The heap memory curve keeps rising , Close to the upper limit , Into a straight line
Log error java.lang.OutOfMemoryError: Java heap space Memory gradually rises
3. Location method of memory overflow
adopt jmap command :jmap -histo pid | head -20, View the number of instances in the current heap memory and the first instance that occupies the most memory 20 Objects
adopt jvisualvm, Remote heap dump, And then put dump Download the file , use jvisualvm Open for analysis , You can see more intuitive jvm Information of objects in
4. see JVM Common commands for running status
-gc Garbage collection statistics
-gcnew New generation garbage collection statistics
-gcold Old age garbage collection statistics
-gcutil Garbage collection statistics ( percentage )
-gccapacity Heap memory statistics
-gcmetacapacity Metadata spatial statistics
-gcnewcapacity New generation memory statistics
-gcoldcapacity Memory statistics in the old days
-compiler Compilation statistics
-printcompilation JVM Compilation method statistics
jstat -gc 12141 1000 40 Print gc Information every other 1000ms Print 40 Time
jstat -gcutil 12141 1000 40a. monitor jvm Of GC situation
# Check the process number first
ps -ef|grep java
# monitor GC situation
jstat -gcutil pid 1000 100b. View heap configuration information
# see java Heap configuration information of the process , Space size and configuration information of each area
jmap -head pidc. see jvm Occupation of classes and objects in
jmap -histo pid | head -20d. Heap file dump
# The heap memory is modified dump, Save it as a file
jmap -dump:format=b,file= file name .hdump pid5、 The solution can be considered from the following aspects
increase MaxPermSize Value
Reduce the number of classes needed by the system
Use ClassLoader Load each class reasonably , And recycle it regularly
Reference resources :
https://blog.csdn.net/weixin_46361114/article/details/123175638

About Me: Wheat grains
● The author of this article : Wheat grains , Focus on python、 Data analysis 、 data mining 、 Machine learning related technologies , Also pay attention to the use of Technology
● Author's blog address :https://blog.csdn.net/u010986753
● The title of this series comes from the author's study notes , Partially collated from the network , If there is any infringement or improper place, please understand
● copyright , Welcome to share this article , Reprint please keep the source
● Personal micro signal :pythonbao Contact me and add wechat Group
● personal QQ:87605025
● QQ Communication group py_data :483766429
● official account :python treasure or DB treasure
● Provide OCP、OCM And the most practical skills training with high availability
● If there is anything wrong with the answer to the question , I also hope that you can criticize and correct , Common progress

If you find the article helpful , Click on my avatar below , Appreciate me !
With your support , The wheat grain will be better and better !
边栏推荐
- Sorting of common AR and MR head mounted display devices
- Flink function (2): checkpointedfunction
- Flink restart policy
- Leetcode剑指offer JZ9 双栈实现队列
- Set up a WordPress personal blog locally and launch it through the intranet (22)
- Lua Foundation
- Unity shader: realize diffuse reflection and specular reflection
- Ia note 1
- NTP error: no server suitable for synchronization found
- What is monotonic queue
猜你喜欢

Leetcode剑指offer JZ9 双栈实现队列

The public network uses Microsoft Remote Desktop remote desktop to work remotely at any time

Ia note 1

Using keras and LSTM to realize time series prediction of long-term trend memory -lstnet

IP notes (9)

Positional argument after keyword argument

IA课总结(1)

IP notes (11)

常用工作方法总结(7S、SWOT分析、PDCA循环、SMART原则、6W2H、时间管理、WBS、二八原则)

初识图形学
随机推荐
【251】常见的测试工具
IP notes (7)
Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]
Simple but easy to use: using keras 2 to realize multi-dimensional time series prediction based on LSTM
IP笔记(8)
Heap overflow of kernel PWN basic tutorial
不租服务器,自建个人商业网站(3)
unity2D游戏之让人物动起来-上
++cnt1[s1.charAt(i) - ‘a‘];
UE4:浅谈什么是GamePlay框架
常用工作方法总结(7S、SWOT分析、PDCA循环、SMART原则、6W2H、时间管理、WBS、二八原则)
What is monotonic queue
IP笔记(10)
IP notes (8)
一批面试题及答案_20180403最新整理
Hololens 2 Chinese development document MRTK V2
Openpose unity plug-in deployment tutorial
IP lesson summary (3)
Getting started with Lunix commands - user and file permissions (Chmod details)
MySQL数据库—SQL汇总(记得关注我!中国加油!)