tencent / loli_profiler Goto Github PK
View Code? Open in Web Editor NEWMemory instrumentation tool for android app&game developers.
License: Other
Memory instrumentation tool for android app&game developers.
License: Other
Lanuch形式启动时,应该是jdwp不好使 log里显示 ERROR/jdwp : [-] Exception: unpack requires a string argument of length 11。
我换Attach方式启动却好使(说明我配置什么的都正确了)。
这是为什么呢,怎么才能解决launch那个报错呢
framepointer模式
threshold设置成0byte
如此便有大量的cache文件
stop后 loadsymbol
发现merged callstack的tree里面的堆栈错乱,怀疑是不是由于record量较大导致引起了bug?
We need a console version to integrate loli into our automatic test pipeline.
meminfo折线图里面有显示,程序正常运行,就是StackTrack里面什么也不显示,空的。
如下代码 for 中 定义int i。 在嵌套的另一个for中又定义一个 int i。
c++ 这么写没有问题。
但不便于维护代码和后期修改。
void MainWindow::InterpretRecordLibrary(StackRecord& record, StacktraceData& data) {
auto it = callStackMap_.find(record.uuid_);
if (it == callStackMap_.end())
return;
auto& callStack = it.value();
for (int i = 0; i < callStack.size(); i++) {
auto& libName = callStack[i].first;
auto& funcAddr = callStack[i].second;
bool found = false;
for (int i = 0; i < sMapsCache_.size(); i++) {
const auto& cache = sMapsCache_[i];
Matrix for Android v1.0 updates:
Add Memory Hook. A native memory leak detection tool for Android.
Add Pthread Hook. A Java and native thread leak detection tool for Android.
Add Matrix Backtrace Component. A fast native backtrace unwind library based on quicken unwind tables.
It's way faster than libunwind, and if we support this method by default, the usability of loliprofiler will be enhanced.
如题,我们这边可以修改uniyt引擎的源码,但是这个改动希望只对debug包生效,请问有什么办法吗?
改动:
// 修改文件: Tools/Bee/Bee.Toolchain.Android/AndroidNdkCompiler.cs
// if (Optimization != OptimizationLevel.None)
// {
// // important for performance. Frame pointer is only useful for profiling, but
// // introduces additional instructions into the prologue and epilogue of each function
// // and leaves one less usable register.
// yield return "-fomit-frame-pointer";
// }
yield return "-fno-omit-frame-pointer"; // <- 打开Framepointer选项
Will be easier to find leaks after long running.
你好,这个框架说是有unity排查内存泄露的能力,实验下来是不行的,询问后又说需要unity mono层自己定位,unity是自己有profiler可以定位的,但是框架的开发目的就是替代这些能力;
是这样的如果做不到这些能力的话不应该写到readme里面来抬高自己框架的价值,谢谢!!
重启Android机器和电脑也无法连接上设备进行调试,报错信息
Starting application ...
Application Started!
Connecting to application server ...
Connection lost ...
Kill your app or re-plug USB cable and try again.
一直提示如下:
Starting application ...
Application Started!
Connecting to application server ...
Connection lost ...
Kill your app or re-plug USB cable and try again.
翻了下FQA说是可能无法连接 apk中 的服务器,需要提供网络权限。目前判断网络权限应该是的,可以正常连接游戏服务器。是不是还需要前置的集成工作才能使用?logcat没有捕捉到相关的日志
你好,我们想集成到自动化测试中,想了解下是否支持命令行调用的方式
i cannot captured records when i debug my debugable app.
i want to konw is it caused by my UNROOT phone?
and loliprofiler show,
Starting application ...
Application Started!
Connecting to application server ...
Cached 0 records.
Captured 0 records.
我在用strict模式测试大型项目,内存申请频繁。
一般连接成功后用几分钟就会弹出:
Print("Connection lost ...");
Print("Kill your app or re-plug USB cable and try again.");
是否意味着我的程序内存申请过多,又为什么会导致断开连接。(这时我的程序没有退出,只是断开连接了)
在检查时间段Leak时提示需要mark time,但这个操作在ui和文档里都没有看到有做提示,最后阅读源码才看到是Shift+拖拽。
能否改成默认拖拽就是mark Time,Ctrl+拖拽是移动坐标轴;或者是hover时候弹窗提示一下组合键,这个键位组合确实不容易发现,也缺少指引。
如题,之前提了两个issue指出了这个框架的局限性,指出了这个框架夸大了它的分析能力,建议作者修改readme文档,但是作者本跟不解释就直接关了issue,查了下作者还是腾讯比较高级的开发工程师!本人也是腾讯的工程师,这种态度实在不敢苟同
大神 ,我想把文档都看懂一遍, Instrumented 和 Frame pointer 这两个优化的介绍我没太懂。
Unreal Engine 4 和 Unity Engine,是游戏引擎吗,是不是我们项目中没有用Unreal Engine 4 、Unity Engine这两个 ,我就不用看
Instrumented 和 Frame pointer 这俩优化的介绍了。
sindney,你好!
请问LoliProfiler是否支持memalign、mmap/mmap64的监控?
引用网上的资料中的一句话: PSS中已经包含了Private Dirty和Private Clean,但是没包含swapped dirty,所以最终衡量你的进程对物理内存的占用应该是取PSS+Swapped Dirty。
但是看loli的源码中 折线图里面 nativeHeap读的是meminfo dump里的 private dirty 或者psstotal 反正代码应该是没计算 swapped dirty。
这里是否应该加上swapped dirty的值呢?
按照文档:https://github.com/Tencent/loli_profiler/blob/master/docs/GAME_ENGINE_CN.md 修改UE 4.27源码,测试下来发现:
- 修改MallocBinned2.h MallocBinned2.cpp 不能跟踪到实际内存分配
- 修改MallocBinned3.h MallocBinned3.cpp 不能跟踪到
去修改AndroidPlatformMemory.cppx强制降级为FMallocAnsi,可以跟踪到,但发现跟踪到内存增量只有47MB, 但实际PSS增长100MB,有50多MB没跟踪到,求大神解答?
查看/data/local/tmp 已经有libloli.so 和 loli2.conf
adb logcat -s Loli
--------- beginning of system
--------- beginning of main
10-25 12:52:29.793 11204 12234 I Loli : Client disconnected, ecode: 0
10-25 12:53:21.589 12742 12742 I Loli : JNI_OnLoad
10-25 12:53:21.589 12742 12742 I Loli : mode: 0, build: default, minRecSize: 256, blacklist: 0, hookLibs: libunity,libil2cpp,
10-25 12:53:21.589 12742 12742 I Loli : loli start status 0
10-25 12:53:24.429 12742 14281 I Loli : Client connected
10-25 12:54:17.871 12742 14281 I Loli : Client disconnected, ecode: 0
adb logcat -s xhook
--------- beginning of system
--------- beginning of main
OS: Android 10.
Device: HONOR ViewPad 6
如题,这边使用了unity3d c#写了一个可能内存泄露的地方,采用il2cpp编译,监控的so库是v8a的;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Demo : MonoBehaviour
{
private static Sprite leakOne;
public Sprite testSprite;
// Start is called before the first frame update
void Start()
{
leakOne = testSprite;
}
// Update is called once per frame
void Update()
{
}
}
用的是Ue4的 Demo工程,adb logcat -s Loli输出,求楼主看看还有救吗?祈求回复阿
C:\Users\luo>adb logcat -s Loli
--------- beginning of system
--------- beginning of main
11-24 09:41:11.508 7137 7137 I Loli : JNI_OnLoad
11-24 09:41:11.509 7137 7137 I Loli : mode: 1, build: default, minRecSize: 10240, blacklist: 0, hookLibs: libUE4.so,
11-24 09:41:11.510 7137 7137 I Loli : loli start status 0
11-24 09:41:11.512 7137 7241 I Loli : libUE4.so (/data/app/com.YourCompany.luo-NgvYhgqdItpy03Kvqg0OPA==/lib/arm64/libUE4.so) is loaded
11-24 09:41:11.526 7137 7241 I Loli : loaded in Android at 0x6ff93000
11-24 09:41:11.526 7137 7241 E Loli : failed to open
11-24 09:41:11.526 7137 7241 I Loli : Error dlopen:
11-24 09:41:11.541 7137 7241 I Loli : All desired libraries are loaded.
9-18 17:55:51.428 25222 25222 I Loli : JNI_OnLoad
09-18 17:55:51.428 25222 25222 I Loli : mode: 0, build: default, minRecSize: 256, blacklist: 0, hookLibs: libunity,libil2cpp,libmtmap.so,libtbtengine.so,
09-18 17:55:51.429 25222 25222 I Loli : loli start status 0
09-18 17:55:51.432 25222 25342 I Loli : libxxx.so (/data/app/com.) is loaded
09-18 17:55:51.432 25222 25342 I Loli : libxxx.so (/data/app/com.) is loaded
09-18 17:55:51.441 25222 25342 I Loli : loaded in Android at 0x07061000
09-18 17:55:51.441 25222 25342 E Loli : failed to open
09-18 17:55:51.441 25222 25342 I Loli : Error dlopen:
09-18 17:55:51.441 25222 25342 I Loli : loaded in Android at 0x07061000
09-18 17:55:51.441 25222 25342 E Loli : failed to open
09-18 17:55:51.441 25222 25342 I Loli : Error dlopen:
09-18 17:55:51.441 25222 25342 I Loli : loaded in Android at 0x07061000
09-18 17:55:51.441 25222 25342 E Loli : failed to open
09-18 17:55:51.441 25222 25342 I Loli : Error dlopen:
09-18 17:55:51.441 25222 25342 I Loli : loaded in Android at 0x07061000
09-18 17:55:51.441 25222 25342 E Loli : failed to open
09-18 17:55:51.441 25222 25342 I Loli : Error dlopen:
09-18 17:55:53.789 25222 25341 I Loli : Client connected
09-18 17:58:11.492 25222 25341 I Loli : Client disconnected, ecode: 0
launch之后就一直卡在
Injecting libloli.so xxx
你好。我写一个demo测试了一下。在我的demo中,有一个按钮,每点击一次,都会创建一个线程;在这个线程中,通过jni调用了setValue()方法。
在setValue()方法中,有一个for循环,每1s钟通过malloc()分配了一个3.8M的内存;在setValue()的末尾又调用free()方法释放了内存;
我的问题是:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.