L
Leon Lambert
How do i get the amount of memory left for an application to allocate?
We have an application that badly needs redesign because the current
design can under certain circumstances run out of memory. Until we can
redesign it we need to add protections to prevent a crash. I would like
to determine when we are close to running out of memory and do a clean
abort of the current operation.
Using PSApi i can use GetProcessMemoryInfo to get the current
WorkingSetSize. I can't seem to find a number i can compare this against
to calculate approximate memory left. I know there is a hard 2 gig limit
but i think this can be lower based on pagefile sizes and such so would
like to make a Win32 call to get the limit.
Any help on how to figure out how much memory is left for a process to
use would be greatly appreciated.
Leon Lambert
We have an application that badly needs redesign because the current
design can under certain circumstances run out of memory. Until we can
redesign it we need to add protections to prevent a crash. I would like
to determine when we are close to running out of memory and do a clean
abort of the current operation.
Using PSApi i can use GetProcessMemoryInfo to get the current
WorkingSetSize. I can't seem to find a number i can compare this against
to calculate approximate memory left. I know there is a hard 2 gig limit
but i think this can be lower based on pagefile sizes and such so would
like to make a Win32 call to get the limit.
Any help on how to figure out how much memory is left for a process to
use would be greatly appreciated.
Leon Lambert