Comments (4)
同问
from koom.
刚刚测试了一下,自动监测的内存算法是否存在问题呀!(手机华为Mate8)
项目中算法是用Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()
,表示用掉的内存,然后用这个值去除以Runtime.getRuntime().maxMemory()
,表示用掉的内存占总内存的百分比,若高于80(或其他自定义的值),则表示内存超标。
实际测试如下:
当前我将内存增加后的内存情况:
Runtime.getRuntime().maxMemory() 402 653 184 Runtime.getRuntime().totalMemory() : 33 517 790 Runtime.getRuntime().freeMemory() : 919 662
根据算法测试值:
HeapMonitor: 占用比8.095833(结果已经乘以100了) 阈值:85.0
那么,如果是自动监测的话,我的手机永远不可能触发内存分析了 。。。。
from koom.
Q:在内存超过阈值3次之后去抓取的,对吗?
A:对的。
Q:App在打开过程中,只能抓取一次数据吗?
A:是的。
Q:如果是自动监测的话,我的手机永远不可能触发内存分析
A:没理解你的问题。宗旨就是会在濒临OOM时触发,查找出有问题的内存占用,8%的内存占用很正常不会触发分析。
from koom.
Q:在内存超过阈值3次之后去抓取的,对吗?
A:对的。
Q:App在打开过程中,只能抓取一次数据吗?
A:是的。
Q:如果是自动监测的话,我的手机永远不可能触发内存分析
A:没理解你的问题。宗旨就是会在濒临OOM时触发,查找出有问题的内存占用,8%的内存占用很正常不会触发分析。
如果是自动监测的话,我的手机永远不可能触发内存分析——这个可以忽略了,是我自己计算错了,我把freeMemory当成了App剩余可用内存。现在已经弄清楚了,谢谢大佬解答!
from koom.
Related Issues (20)
- dump经常失败,报错 HOT 1
- native 内存检测LeakMonitor 工具,demo app,自身有内存泄露的问题
- 问下libhwui_hack.so 这个so会对 系统libhwui.so进行Hook
- 请问Fast dump可以适配android U吗?当前U上dump hprof全为0KB HOT 11
- App进程maps所有者和所属组被修改为root HOT 5
- 线程泄漏检测疑似存在误报的情况?
- 请问Fast dump在Android 12上 也出现了dump hprof为0KB情况,是12没有全部兼容吗 HOT 8
- 实测相对低端的机器上,Koom report 几乎不会回调 HOT 1
- HeapAnalysisService 启动之后就没有回调,仿照 HeapAnalysisService 使用 shark 很快就分析出了结果,相关执行线程可能存在问题 HOT 1
- MIUI OOMEventManagerFK Failed to mkdir /data/miuilog/stability/memleak/heapdump/ HOT 3
- NativeLeak 泄漏 怎么看啊?
- native monitor leak list is null HOT 1
- R8混淆,补到文档里吧
- [koom-native] 兼容 MTE
- [koom-native] 兼容 MTE HOT 1
- ThreadLeak native 崩溃 HOT 1
- 可以检测malloc内存泄漏,检测不到new内存泄漏?
- heap_analysis进程 OOM HOT 1
- hprof文件剪裁问题
- 泄露分析报告内容不完整 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koom.