IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 或 IMAGE_FILE_NET_RUN_FROM_SWAP 是否存在风险? [英] Are there risks associated with IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP or IMAGE_FILE_NET_RUN_FROM_SWAP?

查看:24
本文介绍了IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 或 IMAGE_FILE_NET_RUN_FROM_SWAP 是否存在风险?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑包含 IMAGE_FILE_REMOVABLE_RUN_FROM_SWAPIMAGE_FILE_NET_RUN_FROM_SWAP PE 标志到我的可执行文件.

I'm thinking of including the IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP and IMAGE_FILE_NET_RUN_FROM_SWAP PE flags to my executable.

这个想法是为了防止从网络运行可执行文件的客户端偶尔看到异常,例如当网络卷在睡眠后无法重新连接时.到目前为止,我们一直建议客户从本地连接的卷中运行可执行文件.

The idea is to prevent occasional exceptions seen by clients who run the executable from the network, for example when network volumes fail to reconnect after sleep. Up to now we have always advised clients to run executables from locally connected volumes.

但是,我对虚拟内存、加载器等了解得还不够多,不知道使用这些 PE 标志会带来哪些风险(如果有的话).

However, I don't know enough about virtual memory, the loader etc. to know what, if any, risks there are associated with using these PE flags.

例如,如果我这样做,我的可执行文件会消耗更多的物理内存,尤其是在同时运行多个可执行文件实例的情况下?

For example, if I do this will more physical memory be consumed by my executable, especially if there are multiple instances of the executable running at the same time?

很抱歉,我无法提供更多潜在风险的示例,但这就是我的问题的性质.我有一种感觉,这样做可能有不利之处,但只是不知道这些不利因素是什么.

I'm sorry that I can't give more examples of potential risks, but that's the nature of my question. I have a feeling that there could be downsides to doing this but simply don't know what those downsides could be.

推荐答案

PE 加载器与虚拟内存管理器协同工作.简而言之,您的可执行文件并没有像按需分页那样加载.当然,也不是按需分页.由于可执行文件被锁定并且不会更改,因此这非常有效.不需要交换;RAM 只包含 MRU 部分.

The PE loader works together vith the virtual memory manager. Simply put, your executable isn't so much loaded as demand-paged in. And, of course, demand-paged out. Since executables are locked and don't change, this works quite well. No swap is needed; RAM just contains the MRU parts.

PE 标志改变了这一点.如果满足条件,则可执行文件不会被锁定并且可能会更改/消失.这意味着 VMM 必须将其所有页面保存在 RAM 或交换区中,即使在启动时也是如此.这是大量的复制和 RAM 使用,但结果是网络的丢失不再导致页面错误.并且当 RAM 不足时,页面不能被丢弃,而是必须保存以进行交换.

The PE flags change this. If the conditions are satisfied, the executable isn't locked and might change/disappear. This means the VMM has to keep all its pages either in RAM or swap, even at startup. That's a lot of copying and RAM use, but as a result the loss of the network no longer causes page-in faults. And when RAM is low, pages can't be discarded but have to be saved to swap.

特别是,这些标志当且仅当条件满足时才起作用.IMAGE_FILE_NET_RUN_FROM_SWAP 不会影响本地运行的应用程序.因此,唯一为 RAM/swap 付出代价的客户是那些选择这样做的客户.

In particular, these flags work if and only if the conditions are satisfied. IMAGE_FILE_NET_RUN_FROM_SWAP does not affect apps that are run locally. So the only customers that pay the price in RAM/swap are those that choose to.

这篇关于IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 或 IMAGE_FILE_NET_RUN_FROM_SWAP 是否存在风险?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆