C# Program to Get the Memory Size For OS Page File using Environment Class Last Updated : 24 Oct, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environment variable settings information, contents of the call stack information, and time since last system boot in milliseconds information. In this article, we will discuss how to find the memory size for the OS Page file. So we can find the memory size of the OS page file by using the SystemPageSize property. This property returns the number of bytes present in the operating system's memory page. Syntax: Environment.SystemPageSize Return Type: The return type of this property is an integer. Example: C# // C# program to find the size of operating // system's memory page. Using Environment Class using System; class GFG{ static public void Main() { // Declare a variable int result; // Now we find the memory size for OS Page file // Using SystemPageSize property of Environment class result = Environment.SystemPageSize; // Display the result Console.WriteLine("The memory size for OS page file is " + result); } } Output: The memory size for OS page file is 4096 Example 2: C# // C# program to find the size of operating // system's memory page. Using Environment Class using System; class GFG{ static public void Main() { // Arithmetic operation int Sum = 1 + 3; Console.WriteLine("Sum:" + Sum); // Declare a variable int res; // Now we find the memory size for OS Page file // Using SystemPageSize property of Environment class res = Environment.SystemPageSize; // Display the result Console.WriteLine("The memory size for OS page file is " + res); } } Output: Sum:4 The memory size for OS page file is 4096 Comment More infoAdvertise with us Next Article C# Program to Get the Machine Name or Host Name Using Environment Class O ojaswilavu8128 Follow Improve Article Tags : C# CSharp-programs Similar Reads C# Program to Get the Path of System Directory Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read C# Program to Get the Machine Name or Host Name Using Environment Class Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environme 1 min read C# Program to Get the Full Path of the Current Directory Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read C# Program to Get the Operating System Version of Computer using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read C# Program to Check if Operating System is 64-bit OS or Not Using Environment Class Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environme 2 min read C# Program to Get the Environment Variables Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 3 min read Like