How can I get the number of free bytes available in memory, in .NET?
Also, can you think of a potentially better random number beside new Random().Next(), DateTime.Now.Ticks, or available system memory?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As for your question regarding memory metrics, look into using performance counters.
You may end up needing to use a different counter, such as “Memory\Free & Zero Page List Bytes,” to get what you want. I recommend experimenting with the performance counters in perfmon.