就编程而言,小足迹意味着什么?
我听说许多库(例如 JXTA 和 PjSIP)的占用空间较小。这是资源消耗少还是其他什么原因?
I heard many libraries such as JXTA and PjSIP have smaller footprints. Is this pointing to small resource consumption or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
占用空间指定应用程序在计算机 RAM 内存中占用的大小。
当谈到内存消耗时,足迹可能有不同的含义。
根据我的经验,内存占用通常不包括堆上分配的内存(动态内存)或从磁盘加载的资源等。这是因为动态分配不是恒定的,并且可能会根据应用程序或模块的使用方式而变化。当报告“低占用空间”或“高占用空间”时,通常需要对所需空间进行恒定或最高测量。
例如,如果在图像编辑器的占用空间报告中包含动态内存,则占用空间将完全取决于用户加载到应用程序中的图像的大小。
在第三方库的上下文中,库作者可以通过确保永远不会将超出绝对需要的代码链接到应用程序二进制文件中来优化库的静态内存占用。在 C 语言中,执行此操作的常用方法是将库函数分发到单独的 c 文件中。这是因为大多数 C 链接器会将 c 文件中的所有代码链接到您的应用程序中,而不仅仅是您调用的函数。因此,如果您将单个函数放入 c 文件中,则链接器在调用它时会将其合并到您的应用程序中。如果您在 c 文件中放入五个函数,链接器可能会将它们全部链接到您的应用程序中,即使您只使用其中之一。
话虽如此,足迹的一般(学术)定义包括各种内存/存储方面。
Footprint designates the size occupied by your application in computer RAM memory.
Footprint can have different meaning when speaking about memory consumption.
In my experience, memory footprint often doesn't include memory allocated on the heap (dynamic memory), or resource loaded from disc etc. This is because dynamic allocations are non constant and may vary depending on how the application or module is used. When reporting "low footprint" or "high footprint", a constant or top measure of the required space is usually wanted.
If for example including dynamic memory in the footprint report of an image editor, the footprint would entirely depend on the size of the image loaded into the application by the user.
In the context of a third party library, the library author can optimize the static memory footprint of the library by assuring that you never link more code into your application binary than absolutely needed. A common method used for doing this in for instance C, is to distribute library functions to separate c-files. This is because most C linkers will link all code from a c-file into your application, not just the function you call. So if you put a single function in the c-file, that's all the linker will incoporate into your application when calling it. If you put five functions in the c-file the linker will probably link all of them into your app even if you only use one of them.
All this being said, the general (academic) definition of footprint includes all kinds of memory/storage aspects.
来自维基百科内存占用文章:
From Wikipedia Memory footprint article:
一般来说,它是它占用的内存量——运行时在内存中留下的“足迹”。然而,它也可以指它在硬盘上占用了多少空间——尽管现在这已经不是什么问题了。
如果您正在编写应用程序并且有内存限制,请考虑运行分析器来跟踪程序的使用量。
Generally it's the amount of memory it takes up - the 'footprint' it leaves in memory when running. However it can also refer to how much space it takes up on your harddrive - although these days that's less of an issue.
If you're writing an app and have memory limitations, consider running a profiler to keep track of how much your program is using.
它确实指的是资源。特别是记忆力。运行时需要较少的内存。
It does refer to resources. Particularly memory. It requires a smaller amount of memory when running.
是的,内存或磁盘等资源
yes, resources such as memory or disk
计算中的足迹,即计算机程序或计算机机器,被称为程序、进程、代码等占用的设备内存
Footprint in Computing i-e for computer programs or Computer machines is referred as the occupied device memory , for a program , process , code ,etc