就编程而言,小足迹意味着什么?

发布于 2024-08-08 08:01:01 字数 54 浏览 6 评论 0原文

我听说许多库(例如 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

如何视而不见 2024-08-15 08:01:02

占用空间指定应用程序在计算机 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.

夜访吸血鬼 2024-08-15 08:01:02

来自维基百科内存占用文章:

内存占用是指程序运行时使用或引用的主内存量。

这包括各种活动内存区域,例如包含(主要)程序指令(偶尔包含常量)的代码段、数据段(已初始化和未初始化)、堆内存、调用堆栈以及保存任何其他数据结构所需的内存,例如符号表、调试数据结构、打开的文件、映射到当前进程的共享库等,程序在执行时需要这些内容,并且在整个运行过程中至少会加载一次。

From Wikipedia Memory footprint article:

Memory footprint refers to the amount of main memory that a program uses or references while running.

This includes all sorts of active memory regions like code segment containing (mostly) program instructions (and occasionally constants), data segment (both initialized and uninitialized), heap memory, call stack, plus memory required to hold any additional data structures, such as symbol tables, debugging data structures, open files, shared libraries mapped to the current process, etc., that the program ever needs while executing and will be loaded at least once during the entire run.

墨落画卷 2024-08-15 08:01:02

一般来说,它是它占用的内存量——运行时在内存中留下的“足迹”。然而,它也可以指它在硬盘上占用了多少空间——尽管现在这已经不是什么问题了。

如果您正在编写应用程序并且有内存限制,请考虑运行分析器来跟踪程序的使用量。

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.

花开浅夏 2024-08-15 08:01:02

它确实指的是资源。特别是记忆力。运行时需要较少的内存。

It does refer to resources. Particularly memory. It requires a smaller amount of memory when running.

眼眸印温柔 2024-08-15 08:01:02

是的,内存或磁盘等资源

yes, resources such as memory or disk

弥繁 2024-08-15 08:01:02

计算中的足迹,即计算机程序或计算机机器,被称为程序、进程、代码等占用的设备内存

Footprint in Computing i-e for computer programs or Computer machines is referred as the occupied device memory , for a program , process , code ,etc

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文