Cool_Coder
Cool_Coder

Reputation: 5073

How to determine amount of free RAM in C++ application?

  1. I want to determine the amount of free RAM at a particular instant so that I let the user know whether a particular operation is possible or not, depending upon whether necessary amount of RAM is available or not.

EDIT: I found this. But as Travis says, it is some what mix of paging & RAM. I would like to know only the free RAM memory.

  1. Secondly I would like to understand how to use paging in Windows if necessary amount of RAM is not available. Thank You.

Upvotes: 2

Views: 971

Answers (1)

Katjoek
Katjoek

Reputation: 381

About paging: paging is performed automatically if enabled in Windows. No need to change your code to use it.

About free memory: Win32/MFC: How to find free memory (RAM) available?

You could also try to claim the memory. If successful, the operation can be performed. If you are going to use it anyway... This is not the nicest solution.

Upvotes: 2

Related Questions