[英]how can i know the footprint of my .so library?
In embedded we often listen word like low footprint library. 在嵌入式系统中,我们经常像低占用空间的库那样听单词。
so how can i know the footprint of my library.so or library.a file..? 所以我怎么知道我的library.so或library.a文件的足迹呢? how can i calculate that
我该如何计算
is it same as the memory size of that library? 与该库的内存大小相同吗?
The only real why to find out the memory footprint is by running the executable that uses the library and see how it uses it. 找出内存占用量的唯一真实原因是运行使用该库的可执行文件,并查看其使用方式。 An executable typically uses only a subset of a library.
可执行文件通常仅使用库的子集。 For example a library might have a list that holds objects that are dynamically created by the library when a client pushes another item to the list.
例如,一个库可能有一个列表,其中包含当客户端将另一个项目推入列表时由库动态创建的对象。 The more items that are pushed to the list, the more memory consumed by the library.
推入列表的项目越多,库消耗的内存就越多。
You can see how much memory a process consumes (heap and otherwise) by looking in procfs: cat /proc//mem . 通过查看procfs: cat / proc // mem,可以看到一个进程消耗了多少内存(堆或其他)。
" ps aux " will also give you the virtual memory size (VSZ). “ ps aux ”还将为您提供虚拟内存大小(VSZ)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.