Hi,
I want to get current process(only our application) allocated memory usage.
.Net Framework, i got one property for current process memory usage(WorkingSet64).
Sample code:
Process
myProcess = null;myProcess =
Process.Start("notepad.exe");MessageBox
.Show(myProcess.WorkingSet64.ToString());But i searched the same in Compact framework. In openNetCF namespace having some property.
OpenNETCF.
Environment2.WorkingSet;This is returning whole free physical memory. can anyone help me . which are the property or method will return current(particular application) memory usage . if available any other API or namespace, please let me know ASAP.
Thanks,
Raj

how can i get current process(our application) memory usage in .Net CF2.0
comspy
Alex,
My application have morethan 20 forms and we are using lot of images. when we are loading application, just add all the forms into memory. we got an OutOfMemoryException. At the time we checked memory in device application its going morethan 30MB(total system program memory). This is the main issue in my application. then, we solved this problem. Like, we are adding a form based upon the request not a bulk of forms(only one at the time). after processing that for we had disposed explictly including all the images used in the form. now we are maintaining the total system program memory not exceed 26MB. so we are plan to store application memory usage in the Log file.
i tried with following code, its returning only total system program memory usage. i am expecting what is the memory usage in my application(suppose, notpad is working means, its have a some particular memory usage right . just like that).
OpenNETCF.WindowsCE.
MemoryManagement.SystemProgramMemory;if any other method or property similar to SystemProgramMemory property available, please let me know ASAP with some sample codes.
Thanks,
Raj
PhuNA
Hi Alex,
I was read that article, its very useful for me. could you please tell me any method or property for getting only my application memory usage. Now i'm getting total system program usage. but i am expecting only our application memory usage. please give some sample codes for this issue.
Thanks,
Raj
rekhareflection
First of all there is no straightforward way to find the memory allocated for your process due to many reasons that Mike had described. Second of all I think all you should be interested in is how much program memory left when your program runs and what actions (close other programs, dispose some resoures etc...) to make when it reaches some pre-defined level. Here is the old blog post of mine that shows how to close other programs when the program memory drops:
http://blog.opennetcf.org/ayakhnin/PermaLink,guid,f1df04aa-99c0-4e2a-906d-6fcf0c4b0d59.aspx
Thx... Alex
kadabba
In the words of Mike Zintel's: "Working set isn’t a particularly helpful concept in this environment for several reasons..":
http://blogs.msdn.com/mikezintel/archive/2004/12/08/278153.aspx
John24