Finding the end address of virtual memory allocated to a process
I've a process that does some functions including memory read/write operations. I want a thread to be run within that process which will check if the memory allocated to that process is going to exhaust (say 90% memory used). How I'll get the Start and end address of that virtual memory within that task so that I can calculate the limit for stopping the process (i.e. If memory usage exceeds 90% I'll stop the process)
Any help will be appreciated,
Thanks in advance.