Process Memory (RSS)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
对于部署到搭载 Android 9 或更高版本的设备的应用,Process Memory (RSS) 部分会显示应用使用的物理内存量。

图 1. 在性能分析器中查看物理内存。
进程内存 (RSS) 部分中各行的含义如下:
总计:这是您的进程使用的物理内存总量。在基于 Unix 的系统上,这被称为“驻留集大小”,是匿名分配、文件映射和共享内存分配所使用的所有内存的组合。
对于 Windows 开发者,驻留集大小类似于工作集大小。
已分配:此计数器跟踪进程的正常内存分配目前占用了多少物理内存。这些分配均匿名(不由特定文件支持)且不公开(不共享)。在大多数应用中,这由堆分配量(使用 malloc
或 new
)和堆栈内存组成。从物理内存中换出时,这些分配会写入系统交换文件。
文件映射:此计数器会跟踪进程用于文件映射的物理内存量,也就是说,通过内存管理器从文件映射至内存区域的内存。
共享:此计数器跟踪在此进程和系统中其他进程之间共享的内存所用的物理内存量。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Process Memory (RSS)\n\nFor apps deployed to devices running Android 9 or higher, the **Process Memory\n(RSS)** section shows the amount of physical memory in use by the app.\n\n**Figure 1.** Viewing physical memory in the profiler.\n\nHere is what the rows in the **Process Memory (RSS)** section mean:\n\n- **Total** : This is the total amount of *physical* memory in use by\n your process. On Unix-based systems, this is known as the \"Resident Set Size\",\n and is the combination of all the memory used by anonymous allocations, file\n mappings, and shared memory allocations.\n\n For Windows developers, Resident Set Size is analogous to the Working Set\n Size.\n- **Allocated** : This counter tracks how much physical memory is currently used\n by the process's normal memory allocations. These are allocations which are\n anonymous (not backed by a specific file) and private (not shared). In most\n applications, these are made up of heap allocations (with `malloc` or `new`)\n and stack memory. When swapped out from physical memory, these allocations are\n written to the system swap file.\n\n- **File Mappings**: This counter tracks the amount of physical memory the\n process is using for file mappings---that is, memory mapped from files\n into a region of memory by the memory manager.\n\n- **Shared**: This counter tracks how much physical memory is being used to\n share memory between this process and other processes in the system."]]