简体   繁体   English

我怎么知道我的.so库的足迹?

[英]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.

相关问题 如何知道我的二进制可执行文件的内存占用量 - how to know the memory footprint of my binary executable 如何“注册”我的库 libfoo.so 以将其与 `-lfoo` 链接? - How can I “register” my library libfoo.so to link it with `-lfoo`? 如何在我的共享库中包含使用libdvm.so的正确包含文件? - How can I include proper include files for using libdvm.so at my shared library? 如何减少最小Linux进程的内存占用量 - How can I reduce the memory footprint of a minimal Linux process 我如何知道是否正在使用共享库? - How do I know if my shared library is being used? 我怎么知道我的数组在缓存中? - How can i know my array is in cache? 我如何准备或编译从 github 克隆的第三方库,以便我可以在我的程序中引用它? - How do I prepare or compile a third party library cloned from github so I can reference it in my program? 如何知道环境中换行符的代表方式? - How can I know in which way newline is represented in my environment? 如何修复我的无限循环以使其无限运行? - How Can I Fix My Infinite Loop So That It Runs Infinitely? 我怎样才能使共享库中的 function 不能在不声明 static 的情况下被调用? - How can I make is so that a function in a shared library can't be called without declaring it static?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM