SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
MemoryGetFree

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
MemoryGetFree
Author Message
Greig



Joined: 15 Mar 2001
Posts: 49

Post MemoryGetFree Reply with quote

Please see discussion on 14th and 15th May on this forum, regarding the MemoryGetFree function. I am still convinced that this function returns the wrong value (dwAvailPhys + dwAvailPageFile), at least on NT4.

I believe that dwAvailPageFile already includes dwAvailPhys. As I stated at the time, MSDN describes dwAvailPageFile as "Size of available memory to commit, in bytes". So if I had a system with 256MB Physical, and 512MB swapfile, then dwAvailPhys = 256MB and dwAvailPageFile = 768MB. Thus the value returned by MemoryGetFree(dwAvailPhys + dwAvailPageFile) = 1024MB instead of the correct value of 768MB.

I would be grateful if you could comment.

Wed May 29, 2002 7:49 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: MemoryGetFree Reply with quote

The new 24x7 version 3.3 will feature new MemoryGetFreeEx method, which will return just the value of dwAvailPageFile. I hope this is what you want.

In my opinion, there is no such thing as a "total free memory" in latest Windows versions. That's why MS stopped showing it in the About boxes of Explorer and other MS programs. Most programs now show the amount of "free physical memory available to Windows" that doesn't describe anything. Even the Task Manager that you refer to doesn't say anywhere how much free TOTAL memory you have. You can find only separate numbers for the physical memory and free space in the swap file. To complicate the matter, the swap file size is not fixed and if there isn't enough virtual memory (if you are running out of free space in that file) the swap file can grow incrementally till it reaches the maximum size specified in the Control Panel. On the other hand, if there isn't enough free disk space, the swap file can reach the limit before it can reach the maximum size. To make the matter even worse the swap file space is not distributed between programs exactly "as needed". The operation system itself has more privileges and gets the memory first, and the memory is allocated in pages (Kernel memory).

I believe that the COMMIT memory is the amount of memory allocated to programs and the system at any particular moment, including available free space. It doesn't mean the the free COMMIT memory is the TOTAL free memeory as the size of the swap can increase and so the size of the COMMIT memory. The Task Managere

: Please see discussion on 14th and 15th May on this forum, regarding the
: MemoryGetFree function. I am still convinced that this function returns
: the wrong value (dwAvailPhys + dwAvailPageFile), at least on NT4.

: I believe that dwAvailPageFile already includes dwAvailPhys. As I stated at
: the time, MSDN describes dwAvailPageFile as "Size of available memory
: to commit, in bytes". So if I had a system with 256MB Physical, and
: 512MB swapfile, then dwAvailPhys = 256MB and dwAvailPageFile = 768MB. Thus
: the value returned by MemoryGetFree(dwAvailPhys + dwAvailPageFile) =
: 1024MB instead of the correct value of 768MB.

: I would be grateful if you could comment.

Wed May 29, 2002 9:22 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.