Memory instrumentation tool for android app&game developers.

Overview

Overview

LoliProfiler is a C/C++ memory profiling tool for Android games and applications.

LoliProfiler supports profiling debuggable applications out of box. And offers engine specific (UnrealEngine4/Unity) modifications to enable profiling complex or production level games.

Features

  • Profiler client supports Windows 10/7 and Mac OSX Mojave and newer.
  • Work with debuggable applications out of box.
  • Support attaching to running application.
  • Support multiple back-trace implementations.
  • Support profiling complex games by doing some mods with your game engine.
  • Support profiling release build applications on rooted devices.
  • Multiple data view modes: tree map/call tree/memory fragmentation.

Documents

Special Thanks

License

See LICENSE File.

Issues
  • 为什么我的app一直都是Connection lost,只在app刚安装时连上过一次

    为什么我的app一直都是Connection lost,只在app刚安装时连上过一次

    为什么我的app一直都是Connection lost,只在app刚安装时连上过一次。连上大约10s后又断开了,后面再launch,就一直是Connection lost,提示“Kill your app or re-plug USB cable and try again.”,但是重试还是这样。 image

    question 
    opened by lijunhuawhu 9
  • launch后采集几秒钟数据就断开了

    launch后采集几秒钟数据就断开了

    每次launch成功后几秒钟就断连接了,日志如下: Starting application ... Application Started! Connecting to application server ... Connection lost ... Kill your app or re-plug USB cable and try again. Error occurred when capturing screenshot ... 下面是我的配置 image

    opened by jefferson0228 6
  • 测试大型项目时,运行几分钟后会失去tcp连接。

    测试大型项目时,运行几分钟后会失去tcp连接。

    我在用strict模式测试大型项目,内存申请频繁。 一般连接成功后用几分钟就会弹出:

    Print("Connection lost ..."); Print("Kill your app or re-plug USB cable and try again.");

    是否意味着我的程序内存申请过多,又为什么会导致断开连接。(这时我的程序没有退出,只是断开连接了)

    opened by grystudy 5
  • 为什么malloc的内存被free了,但是在Persistent选项中还是可以看到?如何监控app的内存泄漏?

    为什么malloc的内存被free了,但是在Persistent选项中还是可以看到?如何监控app的内存泄漏?

    你好。我写一个demo测试了一下。在我的demo中,有一个按钮,每点击一次,都会创建一个线程;在这个线程中,通过jni调用了setValue()方法。 在setValue()方法中,有一个for循环,每1s钟通过malloc()分配了一个3.8M的内存;在setValue()的末尾又调用free()方法释放了内存;

    我的问题是:

    1. 为什么所有malloc的内存都free了,但是在Persistent选项中,还是看到了malloc()分配的内存?我看文档说,Persistent 选项会筛选出常驻内存,即未被释放的内存申请记录。这里的内存释放了,应该不是常驻内存的。
    2. 为什么loli_profiler监控到的malloc()的调用次数比我实际在代码中调用的malloc()的次数要少得多?是因为有采样处理吗?
    3. 如果我的so中有内存泄漏,我怎么样通过loli_profiler定位到呢?

    image

    image

    opened by lijunhuawhu 4
  • 长时间运行,发现meminfo的nativeheap和我自己累加的不一样,是否是swapdirty未记录导致?

    长时间运行,发现meminfo的nativeheap和我自己累加的不一样,是否是swapdirty未记录导致?

    引用网上的资料中的一句话: PSS中已经包含了Private Dirty和Private Clean,但是没包含swapped dirty,所以最终衡量你的进程对物理内存的占用应该是取PSS+Swapped Dirty。

    但是看loli的源码中 折线图里面 nativeHeap读的是meminfo dump里的 private dirty 或者psstotal 反正代码应该是没计算 swapped dirty。

    这里是否应该加上swapped dirty的值呢?

    opened by grystudy 2
  • 关于 docs/GAME_ENGINE.md 这个说明的不懂之处

    关于 docs/GAME_ENGINE.md 这个说明的不懂之处

    大神 ,我想把文档都看懂一遍, Instrumented 和 Frame pointer 这两个优化的介绍我没太懂。 Unreal Engine 4 和 Unity Engine,是游戏引擎吗,是不是我们项目中没有用Unreal Engine 4 、Unity Engine这两个 ,我就不用看 Instrumented 和 Frame pointer 这俩优化的介绍了。

    documentation 
    opened by grystudy 2
  • 能不能增加一个体现native虚拟内存的曲线

    能不能增加一个体现native虚拟内存的曲线

    大神,我还有一个问题。在我的Demo中,有一个按钮,每点击一次,就使用malloc()分配了100M的内存,并且没有使用free()释放;我连续点击了很多次,但是在这个NativeHeap曲线上没有任何变化,一直是平的。经过验证,我发现NativeHeap是PSS内存,代表的是物理内存的大小,而malloc()分配的内存在没有写入内容前,是虚拟内存。 实际上,在App的使用中,也存在很多这个使用malloc()分配虚拟内存导致的泄漏,能不能增加一个体现native虚拟内存的曲线呢? image

    wontfix 
    opened by lijunhuawhu 1
  •  MainWindow::InterpretRecordLibrary  代码临时变量命名可优化

    MainWindow::InterpretRecordLibrary 代码临时变量命名可优化

    如下代码 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];

    opened by grystudy 1
  • captured 0 records

    captured 0 records

    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.

    opened by HuangYijiu 1
  • Captured 0 records

    Captured 0 records

    image

    image

    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
    
    opened by TryLoveCatch 4
  • Show merged Callbacks展示效果的优化建议

    Show merged Callbacks展示效果的优化建议

    Show merged Callbacks功能我有两个优化意见,供你参考:

    1. Show merged Callbacks的调用栈很长,点击一次展开一级非常麻烦,能不能点击一下一次性自动展开所有的调用堆栈呢?
    2. Show merged Callbacks显示合并后,有种类型的调用堆栈。这两种堆栈其实前面的都是相同的,只有后面几个方法不同,但是分成了两类展示,这里的展示方式可以优化一下: image image
    enhancement 
    opened by lijunhuawhu 1
  • Integrate Matrix Backtrace Component

    Integrate Matrix Backtrace Component

    https://github.com/Tencent/matrix/pull/595

    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.

    enhancement help wanted 
    opened by sindney 0
Releases(v1.1.2)
Owner
Tencent
Tencent
Memory-dumper - A tool for dumping files from processes memory

What is memory-dumper memory-dumper is a tool for dumping files from process's memory. The main purpose is to find patterns inside the process's memor

Alexander Nestorov 29 Feb 5, 2022
The Hoard Memory Allocator: A Fast, Scalable, and Memory-efficient Malloc for Linux, Windows, and Mac.

The Hoard Memory Allocator Copyright (C) 1998-2020 by Emery Berger The Hoard memory allocator is a fast, scalable, and memory-efficient memory allocat

Emery Berger 882 May 13, 2022
Custom memory allocators in C++ to improve the performance of dynamic memory allocation

Table of Contents Introduction Build instructions What's wrong with Malloc? Custom allocators Linear Allocator Stack Allocator Pool Allocator Free lis

Mariano Trebino 1.2k May 9, 2022
MMCTX (Memory Management ConTeXualizer), is a tiny (< 300 lines), single header C99 library that allows for easier memory management by implementing contexts that remember allocations for you and provide freeall()-like functionality.

MMCTX (Memory Management ConTeXualizer), is a tiny (< 300 lines), single header C99 library that allows for easier memory management by implementing contexts that remember allocations for you and provide freeall()-like functionality.

A.P. Jo. 4 Oct 2, 2021
Mesh - A memory allocator that automatically reduces the memory footprint of C/C++ applications.

Mesh: Compacting Memory Management for C/C++ Mesh is a drop in replacement for malloc(3) that can transparently recover from memory fragmentation with

PLASMA @ UMass 1.4k May 7, 2022
A tool for tracking memory allocation based ld-preload

libmallocTrace A tool for tracking memory allocation based ld-preload how to build make cd example && make how to use a simple way is to execute some

赵政 1 Mar 12, 2022
Tool for profiling heap usage and memory management

vizzy > ./build/vizzytrace /tmp/heapinfo.trace /bin/find /home/zznop -name vizzy _ _ ____ ____ ____ _ _ ( \/ )(_ _)(_ )(_ )( \/ ) \ /

Brandon Miller 29 Mar 19, 2022
STL compatible C++ memory allocator library using a new RawAllocator concept that is similar to an Allocator but easier to use and write.

memory The C++ STL allocator model has various flaws. For example, they are fixed to a certain type, because they are almost necessarily required to b

Jonathan Müller 1.1k May 9, 2022
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C

rpmalloc - General Purpose Memory Allocator This library provides a public domain cross platform lock free thread caching 16-byte aligned memory alloc

Mattias Jansson 1.5k May 10, 2022
OpenXenium JTAG and Flash Memory programmer

OpenXenium JTAG and Flash Memory programmer * Read: "Home Brew" on ORIGINAL XBOX - a detailed article on why and how * The tools in this repo will all

Koos du Preez 25 Feb 14, 2022
manually map driver for a signed driver memory space

smap manually map driver for a signed driver memory space credits https://github.com/btbd/umap tested system Windows 10 Education 20H2 UEFI installati

ekknod 71 Apr 9, 2022
A single file drop-in memory leak tracking solution for C++ on Windows

MemLeakTracker A single file drop-in memory leak tracking solution for C++ on Windows This small piece of code allows for global memory leak tracking

null 22 Apr 23, 2022
Dump the memory of a PPL with a userland exploit

PPLdump This tool implements a userland exploit that was initially discussed by James Forshaw (a.k.a. @tiraniddo) - in this blog post - for dumping th

Clément Labro 546 May 14, 2022
Implementation of System V shared memory (a type of inter process communication) in xv6 operating system.

NOTE: we have stopped maintaining the x86 version of xv6, and switched our efforts to the RISC-V version (https://github.com/mit-pdos/xv6-riscv.git)

Viraj Jadhav 5 Feb 21, 2022
An In-memory Embedding of CPython

An In-memory Embedding of CPython This repository contains all the build artifacts necessary to build an embedding of CPython 3.8.2 that can be run en

null 100 Apr 26, 2022
Execute MachO binaries in memory using CGo

Execute Thin Mach-O Binaries in Memory This is a CGo implementation of the initial technique put forward by Stephanie Archibald in her blog, Running E

Dwight Hohnstein 55 Apr 15, 2022
Initialize the 8-bit computer memory with a program to be executed automatically on powering.

Initialize the 8-bit computer memory with a program to be executed automatically on powering. This project is small extension of Ben Eater's computer

Dmytro Striletskyi 62 Dec 13, 2021
Artifacts of that Memory Management Tsoding Session

Artifacts of those Memory Management Tsoding Sessions Quick Start $ make $ ./heap Limitations The pointers to the heap can only be located in the heap

Tsoding 51 May 15, 2022
PoC for CVE-2021-32537: an out-of-bounds memory access that leads to pool corruption in the Windows kernel.

CVE-2021-32537: Out-of-bounds access in RTKVHD64 leading to pool corruption. This is a bug that I reported to Realtek beginning of April 2021. The aff

Axel Souchet 55 Feb 14, 2022