GithubHelp home page GithubHelp logo

zaccurli / procrank_procmem Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 5.0 56 KB

linux procrank and procmem for monitoring memory

License: GNU General Public License v3.0

CMake 6.71% Shell 0.16% Makefile 4.45% C 86.59% C++ 2.09%

procrank_procmem's Introduction

介绍

procrank 和 procmem 可以用于Android内存检测,使用方法可以自行google

内存耗用:VSS/RSS/PSS/USS

• VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)

• RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存)

• PSS - Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)

• USS - Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)

源码位于:/system/extras/procrank

本例源码使用的是Android7.0下的WORKING_DIRECTORY/system/extras文件

已经添加bionic/libc/upstream-openbsd/lib/libc/string/strlcpy.c

依赖

cmake : 本例基于[cmake version 3.11.4]

NDK : 本例基于[android-ndk-r20]clang

使用

  1. 下载并进入目录
git clone [email protected]:ZaccurLi/procrank_procmem.git
cd procrank_procmem
  1. 编译

2.1 首先设置NDK目录

export NDK_HOME_PATH=/ndk_path

2.2 编译

Android编译直接执行build.sh脚本

./build.sh

或执行编译步骤

mkdir build && cd build 
cmake -DARMV7=ON ..
make

不需要Android版本,直接编译主机版本的可以执行

mkdir build && cd build 
cmake ..
make
  1. release_
    内存有已经编译好的32bit release版本: procrank和procmem

可以直接push到手机运行

Android安装

procrankprocmem文件push到手机的/system/xbin目录下,libpagemap.a文件到/system/lib目录下

adb root
adb remount
adb push procrank /system/xbin
adb push procmem /system/xbin

如果没有权限的话,添加权限

chmod 777 /system/xbin/procrank
chmod 777 /system/xbin/procmem

remount命令有问题的话,可以重新挂载system

mount -o remount,rw /system

Contact

zaccurli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.