Why does Windows claim to be low on memory when I have swap space available?

Asked 8 years, 1 month ago
Viewed 1k times
 
5

I have 4GB of RAM. But according to system monitor my PC never uses above 3.1 GB. When it reaches 3.1 GB used apps start to shut down/crash.

Why is that remaining 800MB not used?

I found a few web resources like: The usable memory may be less than the installed memory on Windows 7-based computers

But my PC does not say anything about usable memory. It's only 4GB and not limited.

Also found few other questions here, but every one has usable part displayed. And my PC does not show it.

 

I get the following error almost constantly:

 

Shouldn't it use swap instead of issuing errors?

Just a thought: I have less than 10% free space on disks, and they're red. It's still plenty of space on HDD, but maybe Windows then tries not to use swap?

Memory monitor: 

 

Also, a screenshot of how swap file looks like when errors appear: 

 

  • 1
    The loaded OS needs RAM, likely to be the 800MB that you are "missing". 
    – Hannu
     Aug 24, 2015 at 14:36
  • 2
    @DragonLord read carefully. First of all its 64-bit. Secondly, sees all memory 
    – Gacek
     Aug 24, 2015 at 15:15
  • 2
    @qasdfdsaq Reopening is possible in both the pending and closed states. I have edited this question to try to make it more clear that it is not asking the same thing as the other questions. Also I have cast a vote to reopen this question. If this question is asked again as a new question, there is some risk of confusion because the new question could be considered a duplicate of this question.   Aug 25, 2015 at 16:26
  • 2
    @Gacek What makes you sure your swap file isn't being used? The image you posted of Task Manager's Performance tab indicates have 10 GB of Committed RAM. If this question were open right now I'd post an answer stating that you don't have 800 MB free RAM and that your swap file isn't large enough to accommodate your system's memory demand.   Aug 25, 2015 at 19:37
  • 1
    @twisty In other words, everything is normal here. Only things to do are to free up some hard drive space and/or add more RAM chips.   Aug 25, 2015 at 20:49

1 Answer

6
 

You really are out of memory (virtual memory, that is)

Take a look at your the Commit Charge as highlighted in your Task Manager screen shot:

 

First number = Current commit
Second number = Commit limit

According to this Super User answer:

The commit limit = current pagefile size + RAM size - RAM permanently allocated to nonpageable memory.

This is a hard limit: Windows cannot grant requests by programs for more memory beyond it. This screen shot indicates you have 10 GB of a possible 10 GB allocated to programs. This is triggering the "Out of memory" message.

What to do?

  1. Install more physical RAM. This will increase your Commit Limit accordingly and improve your computer's performance.

  2. Increase the size of your page file. This too will increase your Commit Limit, but because paging slows down a computer, don't expect any performance benefit.

  3. Close programs that are using the most memory. You can return to the Memory tab in Resource Monitor and sort the processes by the Commit (KB) column to see which ones are having the greatest impact on your memory use. Perhaps you have a program that's using too much memory that can be closed. Be aware that "The total commit charge will always be larger than the sum of these values, as the total includes system-wide allocations such as the paged pool." (Source)

  •  
    Increased paging size limit. 4GB RAM + 10000MB Pagefile (init size) gave me x/13GB commit size. Hope this will suffice for now. But thanks to this i know (or think) now I could utilize even 16GB of RAM. Getting new spec soon and plan to make it 16GB + space for additional 16GB just in case. My current system is 2/2 RAM slots. Very much thank you for your answer. Didnt know what this filed was before. 
    – Gacek
     Aug 26, 2015 at 14:55
  • 1
    Correct. Commit is the total amount of comitted memory that has been requested but not necessarily used. A lot of applications speculatively request more memory than actually needed but this all has to be physically backed somewhere, i.e. with RAM or a pagefile. In extreme cases you could have a program that requires 100MB request 100GB ,and you would need a 100GB pagefile to run it.   Aug 26, 2015 at 15:17
  • 1
    @Twisty Acually what DanielB said is clearer to me. I may not be windows memory management spec. I'm just a simple webapp programmer and don't care about how windows manages memory. Only care for apps to take as less as possible. And app allocating memory means to me that it takes this memory and it belongs to this app only. 
    – Gacek
     Aug 26, 2015 at 17:34
  • 1
    @Gacek Fair enough. The very reason we have community is so multiple perspectives can bring about the clearest information.   Aug 26, 2015 at 17:37 
  • 1
    Just to note: setting initial level of swap file (my windows does not like to allocate to higher limit and system controlled option fails here. It didn't want to go beyond certain point) high solves all my out of memory errors. Thank you @Twisty :) 
    – Gacek
     Aug 27, 2015 at 16:58

問 8 年零 1 個月前
觀看 次數 1,000 次
 
5

我有 4GB 內存。但根據系統監視器,我的電腦從未使用過 3.1 GB 以上的內存。當達到 3.1 GB 時,使用過的應用程序開始關閉/崩潰。

爲什麼剩下的 800MB 沒有被使用?

我發現了一些網絡資源,例如:可用內存可能小於基於 Windows 7 的計算機上安裝的內存

但我的電腦沒有提及任何有關可用內存的信息。只有4GB,而且沒有限制。

在這裏還發現了一些其他問題,但每個問題都顯示了可用的部分。而我的電腦不顯示它。

系統控制面板圖像

我幾乎不斷地收到以下錯誤:

內存不足錯誤圖像

難道它不應該使用交換而不是發出錯誤嗎?

只是想一想:我的磁盤上的可用空間不到 10%,而且它們是紅色的。HDD 上仍然有足夠的空間,但 Windows 可能會嘗試不使用交換空間?

內存監視器:內存監控圖像

另外,出現錯誤時交換文件的樣子的屏幕截圖: 在此輸入圖像描述

  • 1
    加載的操作系統需要 RAM,可能是您“缺少”的 800MB。 
    – 漢努
     2015 年 8 月 24 日 14:36
  • 2
    @DragonLord 仔細閱讀。首先它是 64 位的。其次,查看所有內存   2015 年 8 月 24 日 15:15
  • 2
    @qasdfdsaq 在掛起和關閉狀態下都可以重新打開。我編輯了這個問題,試圖更清楚地表明它並沒有問與其他問題相同的事情。我也投票重新討論這個問題。如果將此問題作爲新問題再次提出,則存在一些混淆的風險,因爲新問題可能被視爲此問題的重複。   2015 年 8 月 25 日 16:26
  • 2
    @Gacek 什麼讓你確定你的交換文件沒有被使用?您發佈的任務管理器“性能”選項卡的圖像表明有 10 GB 的承諾 RAM。如果這個問題現在開放,我會發佈一個答案,指出您沒有 800 MB 可用 RAM,並且您的交換文件不夠大,無法滿足系統的內存需求。   2015 年 8 月 25 日 19:37
  • 1
    @twisty 換句話說,這裏一切正常。唯一要做的就是釋放一些硬盤空間和/或添加更多 RAM 芯片。   2015 年 8 月 25 日 20:49

1 個回答

6
 

你確實內存不足(即虛擬內存)

查看任務管理器屏幕截圖中突出顯示的提交費用:

 

第一個數字 = 當前提交
第二個數字 = 提交限制

根據這位超級用戶的回答

提交限制 = 當前頁面文件大小 + RAM 大小 - 永久分配給不可分頁內存的 RAM。

這是一個硬性限制:Windows 無法授予程序對超出該限制的更多內存的請求。此屏幕截圖表明您有 10 GB,其中可能有 10 GB 分配給程序。這會觸發“內存不足”消息。

該怎麼辦?

  1. 安裝更多物理 RAM。這將相應地增加您的提交限制並提高您的計算機的性能。

  2. 增加頁面文件的大小這也會增加您的提交限制,但由於分頁會減慢計算機的速度,因此不要指望任何性能優勢。

  3. 關閉使用最多內存的程序。 您可以返回資源監視器中的“內存”選項卡,並按列對進程進行排序Commit (KB),以查看哪些進程對內存使用影響最大。也許您的程序使用了太多內存,可以將其關閉。請注意,“總提交費用將始終大於這些值的總和,因爲總數包括系統範圍的分配,例如分頁池。” 來源

  •  
    增加分頁大小限制。4GB RAM + 10000MB 頁面文件(初始化大小)給了我 x/13GB 提交大小。希望現在就足夠了。但多虧了這一點,我知道(或認爲)現在我什至可以利用 16GB 的 RAM。儘快獲得新規格並計劃將其設爲 16GB + 額外 16GB 空間以防萬一。我當前的系統是 2/2 RAM 插槽。非常感謝您的回答。之前不知道這個文件是什麼。   2015 年 8 月 26 日 14:55
  • 1
    正確的。提交是已請求但不一定使用的提交內存總量。許多應用程序推測地請求比實際需要更多的內存,但這一切都必須在某個地方進行物理支持,即使用 RAM 或頁面文件。在極端情況下,您可能有一個需要 100MB 請求 100GB 的程序,並且您需要 100GB 頁面文件來運行它。   2015 年 8 月 26 日 15:17
  • 1
    @Twisty Acually DanielB 所說的對我來說更清楚。我可能不是windows內存管理規範。我只是一個簡單的webapp程序員,並不關心windows如何管理內存。只關心應用程序佔用儘可能少的資源。分配內存的應用程序對我來說意味着它佔用該內存並且僅屬於該應用程序。   2015 年 8 月 26 日 17:34
  • 1
    @Gacek 足夠公平了。我們擁有社區的原因是多個視角可以帶來最清晰的信息。   2015 年 8 月 26 日 17:37 
  • 1
    只是要注意:設置交換文件的初始級別(我的Windows不喜歡分配到更高的限制,系統控制選項在這裏失敗。它不想超出某個點)高可以解決我所有的內存不足錯誤。謝謝你@Twisty:)   2015 年 8 月 27 日 16:58
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章