首页 > 其他分享 >Virtual memory running out when there are free physical memory?

Virtual memory running out when there are free physical memory?

时间:2023-09-28 16:24:39浏览次数:47  
标签:RAM sheet when there share memory data se

Virtual memory running out when there are free physical memory?

Ask Question Asked 7 years, 8 months ago Modified 7 years, 8 months ago Viewed 1k times

 

  1

My firefox suddenly become sluggish and then froze. I opened Process Explorer to see what's going on and noticed the main thread of firefox.exe was stuck in the kernal function NtAllocateVirtualMemory. At that time, the process was only using 1.5GB of virtual memory space and I had more than 1GB of commit limit free and at least 1GB of RAM free. I thought the memory space of Firefox might have become too fragmented, so I killed it.

Then I got a surprise graph like below.

screen shot

As you can see, there has always been RAM free during the entire period but I seemed to have hit commit limit anyhow. The page files are set to system managed and the system drive have more than 17GB free, so I have no idea how I could hit the limit.... Any thoughts on this?

System is Windows 10 build 10586. I have 8GB of RAM.

(It seems Firefox or some related thing has claimed a hidden 3-4 GB of virtual memory space. I think it could be the display driver, but why did the system not expand the page file?)

Share Improve this question   asked Jan 15, 2016 at 23:58 billc.cn's user avatar billc.cn 7,0992020 silver badges3636 bronze badges
  •   Are you running a 32-bit version of Firefox?  – spherical_dog  Jan 16, 2016 at 0:06
  •   Yes, it is 32 bit, but I can normally go up to 1.9GB of virtual memory use with no problem what so ever.  – billc.cn  Jan 16, 2016 at 0:09
  •   Well, the virtual memory limit for a single 32-bit process is 2GB if it is not large address space aware. 32-bit Firefox is supposed to be address space aware, which doesn't explain the crash, but you might want to test the 64-bit version and see if it crashes.  – spherical_dog  Jan 16, 2016 at 0:13
Add a comment

1 Answer

4  

Physical memory and commit limit are distinct resources. You can run out of one even though you have plenty of the other left. You most likely need a larger page file to raise the commit limit.

Physical memory is very much like cash in the bank. Commit limit is very much like checks that you've already written. Even if you have lots of cash in the bank, if you've written a lot of checks, you may be unable to write more checks.

Say you have a system with 3GB of free RAM and no page file. And say an application asks for 2GB of memory. The system will say "yes" and raise the commit limit by 2GB. The system still has 3GB of free RAM, because the application hasn't used any yet. But if another application requests 2GB of memory, the OS will have to refuse. It has 3GB in the bank but has written a check for 2GB, so it can't write another check for 2GB.

Share Improve this answer   answered Jan 16, 2016 at 0:14 David Schwartz's user avatar David Schwartz 61.6k77 gold badges100100 silver badges149149 bronze badges
  •   Okay, this I don't get (even though all the evidences point to it). In my naive computer science-y understanding, the commit limit should be page-able RAM + page file. How could it not be able to use all the RAM? Any pointer to any reading I can do? Also, does not explain why the OS failed to expand the page file as it is set to system managed.  – billc.cn  Jan 16, 2016 at 0:20 
  •   I get the argument in your example, but at that point I killed Firefox, it can at most request 500MB more memory before it runs out of process address space. However, the system was 1GB below the commit limit. (I've realised the commit graph has a scaling issue due to the limit nearly halved after FF was killed.)  – billc.cn  Jan 16, 2016 at 0:33
  •   @billc.cn Taking your questions in order: It can use all the RAM (for example, to fulfill existing obligations), it just can't reserve any more memory, so requests to reserve memory fail. The OS didn't expand the page file because memory was reserved but not used, the page file won't be expanded until it's used. Likely, at least part of your issue was also that the 32-bit process' virtual address space was fragmented.  – David Schwartz  Jan 17, 2016 at 0:22
  •   @billc.cn The point that I think is not clear is that even though total RAM is part of the commit limit, RAM is not marked as "used" just because virtual memory has been committed. If I commit 1 GB, that uses 1 GB of the system commit limit, but it doesn't actually use any RAM at all until I store something in that region. And then it only uses as much as needed to store what I've written. After a while it may use less than that, if I don't reference it much and the OS decides to move some of it to the pagefile to make it more available for some other, higher-activity process.  – Jamie Hanrahan  Apr 7, 2018 at 18:22 
Add a comment

虚拟内存耗尽时还有空闲物理内存吗?

问问题 问 7年零8个月前 7年零8个月前修改 观看 次数 1,000 次

 

  1

我的火狐突然变得迟钝,然后就死机了。我打开 Process Explorer 看看发生了什么,发现 firefox.exe 的主线程卡在了 kernal function 中NtAllocateVirtualMemory。当时,该进程仅使用 1.5GB 的虚拟内存空间,并且我有超过 1GB 的可用提交限制和至少 1GB 的可用 RAM。我认为Firefox的内存空间可能变得过于碎片化,所以我把它杀掉了。

然后我得到了一张令人惊讶的图表,如下所示。

截屏

正如你所看到的,在整个期间内存一直是空闲的,但我似乎已经达到了提交限制。页面文件设置为系统管理,系统驱动器有超过 17GB 的可用空间,所以我不知道如何达到限制......对此有什么想法吗?

系统是Windows 10 build 10586。我有8GB RAM。

(好像Firefox或其他相关的东西声称隐藏了3-4GB的虚拟内存空间。我认为这可能是显示驱动程序,但为什么系统没有扩展页面文件?)

分享 改进这个问题   2016年1月15日 23:58 提问 billc.cn的用户头像 账单网 7,0992020枚银质徽章3636枚青铜徽章
  •   您运行的是 32 位版本的 Firefox 吗?  – 球形狗  2016 年 1 月 16 日 0:06
  •   是的,它是 32 位的,但我通常可以使用高达 1.9GB 的虚拟内存,没有任何问题。  – 账单网  2016 年 1 月 16 日 0:09
  •   如果单个 32 位进程不支持大地址空间,则其虚拟内存限制为 2GB。32 位 Firefox 应该具有地址空间感知能力,这并不能解释崩溃的原因,但您可能想测试 64 位版本并查看它是否崩溃。  – 球形狗  2016 年 1 月 16 日 0:13
添加评论

1 个回答

4  

物理内存和提交限制是不同的资源。即使你还有很多剩余的,你也可能会用完其中之一。您很可能需要更大的页面文件来提高提交限制。

物理内存很像银行里的现金。提交限制非常类似于您已经编写的检查。即使你在银行里有很多现金,如果你写了很多支票,你也可能无法写更多的支票。

假设您的系统有 3GB 可用 RAM 并且没有页面文件。假设某个应用程序需要 2GB 内存。系统会说“是”并将提交限制提高 2GB。系统仍然有 3GB 的可用 RAM,因为应用程序尚未使用任何 RAM。但如果另一个应用程序请求 2GB 内存,操作系统将不得不拒绝。它在银行中有 3GB,但已经写了一张 2GB 的支票,因此它无法再写一张 2GB 的支票。

分享 改进这个答案   回复于2016 年 1 月 16 日 0:14 大卫·施瓦茨的用户头像 大卫·施瓦茨 61.6k77 个金色徽章100100 个银质徽章149149枚青铜徽章
  •   好吧,我不明白这一点(尽管所有证据都表明这一点)。根据我天真的计算机科学理解,提交限制应该是可分页 RAM + 页面文件。怎么可能无法使用所有 RAM?有什么可以指导我阅读的内容吗?另外,没有解释为什么操作系统无法扩展页面文件,因为它设置为系统管理。  – 账单网  2016 年 1 月 16 日 0:20 
  •   我得到了你的例子中的论点,但那时我杀死了 Firefox,它在耗尽进程地址空间之前最多可以请求 500MB 的内存。但是,系统比提交限制低 1GB。(我意识到提交图存在缩放问题,因为 FF 被杀死后限制几乎减半。)  – 账单网  2016 年 1 月 16 日 0:33
  •   @billc.cn 按顺序回答您的问题:它可以使用所有 RAM(例如,履行现有义务),它只是无法保留更多内存,因此保留内存的请求失败。操作系统没有扩展页面文件,因为内存被保留但没有使用,页面文件在使用之前不会被扩展。可能,您的问题的至少一部分还在于 32 位进程的虚拟地址空间是碎片化的。  – 大卫·施瓦茨  2016 年 1 月 17 日 0:22
  •   @billc.cn 我认为不清楚的一点是,即使总 RAM 是提交限制的一部分,RAM 也不会仅仅因为虚拟内存已提交而被标记为“已使用”。如果我提交 1 GB,则会使用 1 GB 的系统提交限制,但在我在该区域存储某些内容之前,它实际上根本不使用任何 RAM。然后它只使用存储我所写内容所需的量。一段时间后,如果我不太多引用它,并且操作系统决定将其中一些内容移动到页面文件,以使其更可用于其他一些活动较高的进程,那么它可能会使用更少的内容。  – 杰米·汉拉汉  2018 年 4 月 7 日 18:22 
添加评论  

标签:RAM,sheet,when,there,share,memory,data,se
From: https://www.cnblogs.com/ioriwellings/p/17736026.html

相关文章

  • 34 GB of commited memory but no app actually commited that much
    34GBofcommitedmemorybutnoappactuallycommitedthatmuchAskQuestionAsked 3years,8monthsagoModified 3years,8monthsagoViewed 493times 3SometimesIencounterOutofmemoryerrorsandWindowsEventViewershowsthis(tra......
  • E---句子中的there 与 here
    译文:CallstodisassemblealltelescopesonMaunaKeaortobanfuturedevelopmentthere ignoretherealitythatastronomyandHawaiianculturebothseektoanswerbigquestionsaboutwhoweare,wherewecomefromandwherewearegoing.翻译:拆除莫纳克亚......
  • 【从0学习Solidity】 5. 变量数据存储和作用域 storage/memory/calldata
    【从0学习Solidity】5.变量数据存储和作用域storage/memory/calldata博主简介:不写代码没饭吃,一名全栈领域的创作者,专注于研究互联网产品的解决方案和技术。熟悉云原生、微服务架构,分享一些项目实战经验以及前沿技术的见解。关注我们的主页,探索全栈开发,期待与您一起在移动开发的......
  • ORA-04030: out of process memory when trying to allocate 27760032 bytes (qmxuPar
    1.alter日志2023-09-24T19:59:02.474578+08:00LOGMINER:Beginmininglogfileforsession-2147289087thread1sequence2185,+DATA/DB/ONLINELOG/redo05a.log2023-09-24T19:59:02.481095+08:00LOGMINER:Beginmininglogfileforsession-2147289087thread2sequence......
  • crash —— 如何获取IO port和IO memory使用情况
    在linux中通过/proc/ioport和/proc/iomem可以获取系统的IO端口和内存的布局信息,在crash中需要使用dev命令来获取。crash>dev-iRESOURCERANGENAMEffffffff822668c00000-ffffPCIIOffff88deafffd5a00000-0cf7PCIBus0000:00ffffffff822407000000-......
  • win10 按键盘偶尔会出现一个光圈when pressing ctrl, randomly a white circle thing
    whenpressingctrl,randomlyawhitecirclethingappearsaroundmymousecurser.SolutionTwo:Thisonlyappliesifyouhave"Powertoys"installed. OpenPowertoysNavigateto'Mouseutilities'onthesidepanel.Turnoff'......
  • 用ZwQueryVirtualMemory枚举进程模块
    用ZwQueryVirtualMemory枚举进程模块枚举进程模块通常可以使用诸如:CreateToolhelp32Snapshot,Module32First,Module32Next等"ToolHelpFunctions"接口来实现,并且这也是最通用的方法(从Win95就开始支持了),但是今天我们要介绍的是ntdll.dll导出的未文档化接口ZwQueryVirtualM......
  • yarn 出现 【 info There appears to be trouble with your network connection. Retr
    第一种解决方案#调整为taobao镜像源yarnconfigsetregistryhttps://registry.npm.taobao.org我用了没用,可以试试第二种解决方案要在项目根目录下创建后缀名为.yarnrc的文件,并设置network-timeout的值为600000,你可以按照以下步骤进行操作:打开文本编辑器,例如Note......
  • MO Memory
    关于MO和OI的选拔体系```MO:省赛——联赛——国赛省赛:各省组织,时间不同但多在4~6月。按成绩选出参加联赛选手。浙江省的省赛全称“浙江省高中数学联赛”,5月进行。联赛:旧称“全国高中数学联赛”,现在全称“全国中学生数学奥林匹克竞赛(初赛)”,通常简称联赛。举行于9月第二......
  • JDBC Batch Insert OutOfMemoryError
    Ihavewrittenamethodinsert()inwhichIamtryingtouseJDBCBatchforinsertinghalfamillionrecordsintoaMySQLdatabase:publicvoidinsert(intnameListId,String[]names){Stringsql="INSERTINTOname_list_......